Class Bone
Represents a bone in a skeletal animation system.
Assembly: Genesis.dll
Syntax
Constructors
Bone(string, int, NodeAnimationChannel)
Initializes a new instance of the Bone class.
Declaration
public Bone(string name, int id, NodeAnimationChannel channel)
Parameters
Type |
Name |
Description |
string |
name |
|
int |
id |
|
NodeAnimationChannel |
channel |
|
Properties
ID
Declaration
public int ID { get; set; }
Property Value
Local transformation matrix of the bone.
Declaration
public mat4 LocalTransform { get; set; }
Property Value
Name
Declaration
public string Name { get; set; }
Property Value
NumPositions
Number of position keyframes.
Declaration
public int NumPositions { get; set; }
Property Value
NumRotations
Number of rotation keyframes.
Declaration
public int NumRotations { get; set; }
Property Value
NumScalings
Number of scale keyframes.
Declaration
public int NumScalings { get; set; }
Property Value
Positions
List of position keyframes for the bone.
Declaration
public List<KeyPosition> Positions { get; set; }
Property Value
Rotations
List of rotation keyframes for the bone.
Declaration
public List<KeyRotation> Rotations { get; set; }
Property Value
Scales
List of scale keyframes for the bone.
Declaration
public List<KeyScale> Scales { get; set; }
Property Value
Methods
GetPositionIndex(float)
Gets the index of the position keyframe at the specified animation time.
Declaration
public int GetPositionIndex(float animationTime)
Parameters
Type |
Name |
Description |
float |
animationTime |
|
Returns
GetRotationIndex(float)
Gets the index of the rotation keyframe at the specified animation time.
Declaration
public int GetRotationIndex(float animationTime)
Parameters
Type |
Name |
Description |
float |
animationTime |
|
Returns
GetScaleFactor(float, float, float)
Calculates the interpolation factor between two keyframes.
Declaration
public float GetScaleFactor(float lastTimeStamp, float nextTimeStamp, float animationTime)
Parameters
Type |
Name |
Description |
float |
lastTimeStamp |
|
float |
nextTimeStamp |
|
float |
animationTime |
|
Returns
GetScaleIndex(float)
Gets the index of the scale keyframe at the specified animation time.
Declaration
public int GetScaleIndex(float animationTime)
Parameters
Type |
Name |
Description |
float |
animationTime |
|
Returns
InterpolatePosition(float)
Interpolates position for the bone at the specified animation time.
Declaration
public mat4 InterpolatePosition(float animationTime)
Parameters
Type |
Name |
Description |
float |
animationTime |
|
Returns
InterpolateRotation(float)
Interpolates rotation for the bone at the specified animation time.
Declaration
public mat4 InterpolateRotation(float animationTime)
Parameters
Type |
Name |
Description |
float |
animationTime |
|
Returns
InterpolateScaling(float)
Interpolates scale for the bone at the specified animation time.
Declaration
public mat4 InterpolateScaling(float animationTime)
Parameters
Type |
Name |
Description |
float |
animationTime |
|
Returns
Update(float, bool)
Updates the bone transformation based on the animation time.
Declaration
public void Update(float animationTime, bool interpolate)
Parameters
Type |
Name |
Description |
float |
animationTime |
|
bool |
interpolate |
|