|
|||||||||||
| 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.SpatialTransformer
Started Date: Jul 9, 2004
This class animates spatials by interpolating between various
transformations. The user defines objects to be transformed and what
rotation/translation/scale to give each object at various points in time. The
user must call interpolateMissing() before using the controller in order to
interpolate unspecified translation/rotation/scale.
| Nested Class Summary | |
class |
SpatialTransformer.PointInTime
Defines a point in time where at time time, ohject
toChange[i] will assume transformation
look[i]. |
| Field Summary | |
java.util.ArrayList |
keyframes
Interpolated array of keyframe states |
int[] |
parentIndexes
parentIndexes[i] states that toChange[i]'s parent is toChange[parentIndex[i]]. |
Spatial[] |
toChange
Refrences to the objects that will be changed. |
| Fields inherited from class com.jme.scene.Controller |
RT_CLAMP, RT_CYCLE, RT_WRAP |
| Constructor Summary | |
SpatialTransformer(int numObjects)
Constructs a new SpatialTransformer that will operate on numObjects Spatials |
|
| Method Summary | |
int |
getNumObjects()
Returns the number of Objects used by this SpatialTransformer |
void |
interpolateMissing()
This must be called one time, once all translations/rotations/scales have been set. |
Controller |
putClone(Controller store,
CloneCreator properties)
This function should be overridden by any Spatial objects that want their Controller cloned by a CloneCreator. |
void |
setObject(Spatial objChange,
int index,
int parentIndex)
Sets an object to animate. |
void |
setPosition(int indexInST,
float time,
Vector3f position)
Sets object with index indexInST to translate by
position at time time. |
void |
setRotation(int indexInST,
float time,
Quaternion rot)
Sets object with index indexInST to rotate by
rot at time time. |
void |
setScale(int indexInST,
float time,
Vector3f scale)
Sets object with index indexInST to scale by
scale at time time. |
void |
update(float time)
Defined by extending classes, update is a signal to
Controller that it should update whatever object(s) it is controlling. |
| 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 Spatial[] toChange
public int[] parentIndexes
public java.util.ArrayList keyframes
| Constructor Detail |
public SpatialTransformer(int numObjects)
numObjects Spatials
numObjects - The number of spatials to change| Method Detail |
public void update(float time)
Controllerupdate is a signal to
Controller that it should update whatever object(s) it is controlling.
update in class Controllertime - The time in seconds between the last call to update and the
current one
public void setObject(Spatial objChange,
int index,
int parentIndex)
index and
it's parent index is parentIndex. A parent index of -1
indicates it has no parent.
objChange - The spatial that will be updated by this SpatialTransformer.index - The index of that spatial in this transformer's arrayparentIndex - The parentIndex in this transformer's array for this Spatial
public void setRotation(int indexInST,
float time,
Quaternion rot)
indexInST to rotate by
rot at time time.
indexInST - The index of the spatial to changetime - The time for the spatial to take this rotationrot - The rotation to take
public void setPosition(int indexInST,
float time,
Vector3f position)
indexInST to translate by
position at time time.
indexInST - The index of the spatial to changetime - The time for the spatial to take this translationposition - The position to take
public void setScale(int indexInST,
float time,
Vector3f scale)
indexInST to scale by
scale at time time.
indexInST - The index of the spatial to changetime - The time for the spatial to take this scalescale - The scale to takepublic void interpolateMissing()
public int getNumObjects()
public Controller putClone(Controller store,
CloneCreator properties)
Controller
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 | ||||||||||