Class Animation3D
- Namespace
- LibGFX.Graphics.Animation3D
- Assembly
- LibGFX.dll
Represents an animation associated with a 3D model.
public class Animation3D
- Inheritance
-
Animation3D
- Inherited Members
Constructors
Animation3D()
Initializes a new instance of the Animation3D class. Used for deserialization purposes.
public Animation3D()
Animation3D(Scene, int)
Initializes a new instance of the Animation class without a model reference.
public Animation3D(Scene scene, int index)
Parameters
sceneSceneindexint
Animation3D(Scene, int, Skeleton)
Initializes a new instance of the Animation class.
public Animation3D(Scene scene, int index, Skeleton skeleton)
Parameters
Properties
BoneInfoMap
Mapping of bone names to bone information.
public Dictionary<string, BoneInfo> BoneInfoMap { get; set; }
Property Value
Bones
List of bones affected by the animation.
public List<Bone> Bones { get; set; }
Property Value
Duration
Duration of the animation in ticks.
public float Duration { get; set; }
Property Value
Name
Name of the animation.
public string Name { get; set; }
Property Value
RootNode
Root node of the animation's scene hierarchy.
public SceneNodeData RootNode { get; set; }
Property Value
TicksPerSecond
Number of ticks per second for the animation.
public float TicksPerSecond { get; set; }
Property Value
Methods
AnimationLength()
Calculates the keyframe length of the animation based on the maximum number of position, rotation, and scaling keyframes among all bones.
public int AnimationLength()
Returns
- int
The maximum number of keyframes (positions, rotations, or scalings) among all bones; if no bones are present, returns -1.
Remarks
This method iterates through all bones to determine the maximum keyframe length.
FindBone(string)
Finds a bone with the specified name.
public Bone FindBone(string name)
Parameters
namestring
Returns
GetKeyFrameIndex(float)
Calculates the keyframe index based on the specified animation time.
public int GetKeyFrameIndex(float animationTime)
Parameters
animationTimefloat
Returns
LoadAnimationChannel(Animation)
public void LoadAnimationChannel(Animation animation)
Parameters
animationAnimation
ReadBones(Skeleton)
Reads bones from the provided skeleton and associates them with the animation.
public void ReadBones(Skeleton skeleton)
Parameters
skeletonSkeleton