|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.scene.Controller
com.jme.animation.KeyframeController
Started Date: Jun 12, 2004
Class can do linear interpolation of a TriMesh between units of time. Similar
to VertexKeyframeController but interpolates float units of
time instead of integer keyframes.
Controller.setSpeed(float) sets a speed relative to the defined speed. For
example, the default is 1. A speed of 2 would run twice as fast and a speed
of .5 would run half as fast
Controller.setMinTime(float) and Controller.setMaxTime(float) both define the
bounds that KeyframeController should follow. It is the programmer's
responsiblity to make sure that the MinTime and MaxTime are within the span
of the defined setKeyframe
Controller functions RepeatType and isActive are both defined in their
default way for KeyframeController
When this controller is saved/loaded to XML format, it assumes that the mesh
it morphs is the TriMesh it belongs to, so it is recomended to only attach
this controller to the TriMesh it animates.
| Nested Class Summary | |
static class |
KeyframeController.PointInTime
This class defines a point in time that states morphShape
should look like newShape at time seconds |
| Field Summary | |
java.util.ArrayList |
keyframes
An array of PointInTime s that defines the animation |
| Fields inherited from class com.jme.scene.Controller |
RT_CLAMP, RT_CYCLE, RT_WRAP |
| Constructor Summary | |
KeyframeController()
Default constructor. |
|
| Method Summary | |
boolean |
getModelUpdate()
Returns true if the model's bounding volume is being updated every frame. |
TriMesh |
getMorphMesh()
|
Controller |
putClone(Controller store,
CloneCreator properties)
This function should be overridden by any Spatial objects that want their Controller cloned by a CloneCreator. |
void |
setKeyframe(float time,
TriMesh shape)
Tells the controller to change its morphMesh to shape at
time seconds. |
void |
setModelUpdate(boolean update)
If true, the model's bounding volume will be updated every frame. |
void |
setMorphingMesh(TriMesh morph)
Sets the Mesh that will be physically changed by this KeyframeController |
void |
setNewAnimationTimes(float newBeginTime,
float newEndTime)
Sets the new animation boundaries for this controller. |
void |
setSmoothTranslation(float newTimeToReach,
float translationLen,
float newBeginTime,
float newEndTime)
This function will do a smooth translation between a keframe's current look, to the look directly at newTimeToReach. |
void |
shallowSetMorphMesh(TriMesh morph)
|
void |
update(float time)
As defined in Controller |
| Methods inherited from class com.jme.scene.Controller |
getMaxTime, getMinTime, getRepeatType, getSpeed, isActive, setActive, setMaxTime, setMinTime, setRepeatType, setSpeed |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public transient java.util.ArrayList keyframes
PointInTime s that defines the animation
| Constructor Detail |
public KeyframeController()
| Method Detail |
public void setMorphingMesh(TriMesh morph)
morph - The new mesh to morphpublic void shallowSetMorphMesh(TriMesh morph)
public void setKeyframe(float time,
TriMesh shape)
shape at
time seconds. Time must be >=0 and shape must be non-null
and shape must have the same number of vertexes as the current shape. If
not, then nothing happens. It is also required that
setMorphingMesh(TriMesh) is called before
setKeyframe. It is assumed that shape.indices ==
morphMesh.indices, otherwise morphing may look funny
time - The time for the changeshape - The new shape at that time
public void setSmoothTranslation(float newTimeToReach,
float translationLen,
float newBeginTime,
float newEndTime)
newTimeToReach - The time to reach.translationLen - How long it takesnewBeginTime - The new cycle begining timenewEndTime - The new cycle ending time.
public void setNewAnimationTimes(float newBeginTime,
float newEndTime)
newBeginTime - The starting timenewEndTime - The ending timepublic void update(float time)
update in class Controllertime - as defined in Controllerpublic void setModelUpdate(boolean update)
update - The new update model volume per frame value.public boolean getModelUpdate()
public TriMesh getMorphMesh()
public Controller putClone(Controller store,
CloneCreator properties)
putClone in class Controllerstore - The Controller to store properties into. If null, null is
returned.properties - The CloneCreator controlling how things should be copied into
the store Controller.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||