Package com.jme3.animation
Class AnimationFactory
java.lang.Object
com.jme3.animation.AnimationFactory
Deprecated.
A convenience class to easily set up a spatial keyframe animation.
You can add some keyFrames for a given time or a given keyFrameIndex, for translation, rotation, and scale.
The animationFactory will then generate an appropriate SpatialAnimation by interpolating values between the keyFrames.
Usage is :
- Create the AnimationFactory
- add some keyFrames
- call the buildAnimation() method that will return a new Animation
- add the generated Animation to any existing AnimationControl
Note that the first keyFrame (index 0) is defaulted with the identity transform. If you want to change that you have to replace this keyFrame with the transform you want.
Usage is :
- Create the AnimationFactory
- add some keyFrames
- call the buildAnimation() method that will return a new Animation
- add the generated Animation to any existing AnimationControl
Note that the first keyFrame (index 0) is defaulted with the identity transform. If you want to change that you have to replace this keyFrame with the transform you want.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected float
Deprecated.Animation duration in secondsprotected int
Deprecated.frames per secondsprotected AnimationFactory.Rotation[]
Deprecated.protected Vector3f[]
Deprecated.protected Vector3f[]
Deprecated.The map of keyFrames to compute the animation.protected String
Deprecated.Name of the animationprotected Quaternion[]
Deprecated.rotation array for this animationprotected Vector3f[]
Deprecated.scales array for this animationprotected float[]
Deprecated.Time array for this animationprotected int
Deprecated.total number of framesprotected float
Deprecated.time per frameprotected Vector3f[]
Deprecated.Translation array for this animation -
Constructor Summary
ConstructorDescriptionAnimationFactory
(float duration, String name) Deprecated.Creates an AnimationFactoryAnimationFactory
(float duration, String name, int fps) Deprecated.Creates an AnimationFactory -
Method Summary
Modifier and TypeMethodDescriptionvoid
addKeyFrameRotation
(int keyFrameIndex, Quaternion rotation) Deprecated.Adds a key frame for the given rotation at the given keyFrame index
This can't be used if the interpolated angle is higher than PI (180°)
UseaddKeyFrameRotationAngles(int keyFrameIndex, float x, float y, float z)
instead that uses Euler angle rotations.void
addKeyFrameRotationAngles
(int keyFrameIndex, float x, float y, float z) Deprecated.Adds a key frame for the given rotation at the given key frame index.
Rotation is expressed by Euler angles in radians.
Note that the generated rotation will be stored as a quaternion and interpolated using a spherical linear interpolation (slerp)
Hence, this method may create intermediate keyFrames if the interpolation angle is higher than PI to ensure continuity in animationvoid
addKeyFrameScale
(int keyFrameIndex, Vector3f scale) Deprecated.Adds a key frame for the given scale at the given keyFrame indexvoid
addKeyFrameTransform
(int keyFrameIndex, Transform transform) Deprecated.Adds a key frame for the given Transform at the given keyFrame indexvoid
addKeyFrameTranslation
(int keyFrameIndex, Vector3f translation) Deprecated.Adds a key frame for the given translation at the given keyFrame indexvoid
addTimeRotation
(float time, Quaternion rotation) Deprecated.Adds a key frame for the given rotation at the given time
This can't be used if the interpolated angle is higher than PI (180°)
UseaddTimeRotationAngles(float time, float x, float y, float z)
instead that uses Euler angle rotations.void
addTimeRotationAngles
(float time, float x, float y, float z) Deprecated.Adds a key frame for the given rotation at the given time.
Rotation is expressed by Euler angles in radians.
Note that the generated rotation will be stored as a quaternion and interpolated using a spherical linear interpolation (slerp)
Hence, this method may create intermediate keyFrames if the interpolation angle is higher than PI to ensure continuity in animationvoid
addTimeScale
(float time, Vector3f scale) Deprecated.Adds a key frame for the given scale at the given timevoid
addTimeTransform
(float time, Transform transform) Deprecated.Adds a key frame for the given Transform at the given timevoid
addTimeTranslation
(float time, Vector3f translation) Deprecated.Adds a key frame for the given translation at the given timeDeprecated.Creates an Animation based on the keyFrames previously added to the factory.
-
Field Details
-
name
Deprecated.Name of the animation -
fps
protected int fpsDeprecated.frames per seconds -
duration
protected float durationDeprecated.Animation duration in seconds -
totalFrames
protected int totalFramesDeprecated.total number of frames -
tpf
protected float tpfDeprecated.time per frame -
times
protected float[] timesDeprecated.Time array for this animation -
translations
Deprecated.Translation array for this animation -
rotations
Deprecated.rotation array for this animation -
scales
Deprecated.scales array for this animation -
keyFramesTranslation
Deprecated.The map of keyFrames to compute the animation. The key is the index of the frame -
keyFramesScale
Deprecated. -
keyFramesRotation
Deprecated.
-
-
Constructor Details
-
AnimationFactory
Deprecated.Creates an AnimationFactory- Parameters:
duration
- the desired duration for the resulting animationname
- the name of the resulting animation
-
AnimationFactory
Deprecated.Creates an AnimationFactory- Parameters:
duration
- the desired duration for the resulting animationname
- the name of the resulting animationfps
- the number of frames per second for this animation (default is 30)
-
-
Method Details
-
addTimeTransform
Deprecated.Adds a key frame for the given Transform at the given time- Parameters:
time
- the time at which the keyFrame must be insertedtransform
- the transform to use for this keyFrame
-
addKeyFrameTransform
Deprecated.Adds a key frame for the given Transform at the given keyFrame index- Parameters:
keyFrameIndex
- the index at which the keyFrame must be insertedtransform
- the transform to use for this keyFrame
-
addTimeTranslation
Deprecated.Adds a key frame for the given translation at the given time- Parameters:
time
- the time at which the keyFrame must be insertedtranslation
- the translation to use for this keyFrame
-
addKeyFrameTranslation
Deprecated.Adds a key frame for the given translation at the given keyFrame index- Parameters:
keyFrameIndex
- the index at which the keyFrame must be insertedtranslation
- the translation to use for this keyFrame
-
addTimeRotation
Deprecated.Adds a key frame for the given rotation at the given time
This can't be used if the interpolated angle is higher than PI (180°)
UseaddTimeRotationAngles(float time, float x, float y, float z)
instead that uses Euler angle rotations.- Parameters:
time
- the time at which the keyFrame must be insertedrotation
- the rotation Quaternion to use for this keyFrame- See Also:
-
addKeyFrameRotation
Deprecated.Adds a key frame for the given rotation at the given keyFrame index
This can't be used if the interpolated angle is higher than PI (180°)
UseaddKeyFrameRotationAngles(int keyFrameIndex, float x, float y, float z)
instead that uses Euler angle rotations.- Parameters:
keyFrameIndex
- the index at which the keyFrame must be insertedrotation
- the rotation Quaternion to use for this keyFrame- See Also:
-
addTimeRotationAngles
public void addTimeRotationAngles(float time, float x, float y, float z) Deprecated.Adds a key frame for the given rotation at the given time.
Rotation is expressed by Euler angles in radians.
Note that the generated rotation will be stored as a quaternion and interpolated using a spherical linear interpolation (slerp)
Hence, this method may create intermediate keyFrames if the interpolation angle is higher than PI to ensure continuity in animation- Parameters:
time
- the time at which the keyFrame must be insertedx
- the rotation around the x axis (aka yaw) in radiansy
- the rotation around the y axis (aka roll) in radiansz
- the rotation around the z axis (aka pitch) in radians
-
addKeyFrameRotationAngles
public void addKeyFrameRotationAngles(int keyFrameIndex, float x, float y, float z) Deprecated.Adds a key frame for the given rotation at the given key frame index.
Rotation is expressed by Euler angles in radians.
Note that the generated rotation will be stored as a quaternion and interpolated using a spherical linear interpolation (slerp)
Hence, this method may create intermediate keyFrames if the interpolation angle is higher than PI to ensure continuity in animation- Parameters:
keyFrameIndex
- the index at which the keyFrame must be insertedx
- the rotation around the x axis (aka yaw) in radiansy
- the rotation around the y axis (aka roll) in radiansz
- the rotation around the z axis (aka pitch) in radians
-
addTimeScale
Deprecated.Adds a key frame for the given scale at the given time- Parameters:
time
- the time at which the keyFrame must be insertedscale
- the scale to use for this keyFrame
-
addKeyFrameScale
Deprecated.Adds a key frame for the given scale at the given keyFrame index- Parameters:
keyFrameIndex
- the index at which the keyFrame must be insertedscale
- the scale to use for this keyFrame
-
buildAnimation
Deprecated.Creates an Animation based on the keyFrames previously added to the factory.- Returns:
- the generated animation
-
AnimFactory