Space Engineers
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
VRageRender.Animations.MyCharacterBone Class Reference

Bones in this model are represented by this class, which allows a bone to have more detail associatd with it. More...

Public Member Functions

 MyCharacterBone (string name, MyCharacterBone parent, Matrix bindTransform, int index, Matrix[] relativeStorage, Matrix[] absoluteStorage)
 Constructor for a bone object More...
 
void ComputeAbsoluteTransform (bool propagateTransformToChildren=true)
 Compute the absolute transformation for this bone. More...
 
bool ComputeBoneTransform ()
 
void SetCompleteTransform (ref Vector3 translation, ref Quaternion rotation, float weight)
 This sets the rotation and translation such that the rotation times the translation times the bind after set equals this matrix. This is used to set animation values. More...
 
void SetCompleteBindTransform ()
 This sets the rotation and translation of the rest pose. More...
 
void SetCompleteTransform (ref Vector3 translation, ref Quaternion rotation)
 This sets the rotation and translation such that the rotation times the translation times the bind after set equals this matrix. This is used to set animation values. More...
 
void SetCompleteTransformFromAbsoluteMatrix (ref Matrix absoluteMatrix, bool onlyRotation)
 Set the rotation and translation of the bone from absolute transform. Does not recompute hierarchy - call ComputeAbsoluteTransform. More...
 
void SetCompleteTransformFromAbsoluteMatrix (Matrix absoluteMatrix, bool onlyRotation)
 Set the rotation and translation of the bone from absolute transform. Does not recompute hierarchy - call ComputeAbsoluteTransform. More...
 
void SetCompleteRotation (ref Quaternion rotation)
 This adds the rotation and translation to the one that is already set inside. More...
 
void GetCompleteTransform (ref Vector3 translation, ref Quaternion rotation, out Vector3 completeTranslation, out Quaternion completeRotation)
 Same as SetCompleteTransform, but result is not stored internally, it is returned instead. More...
 
Matrix GetAbsoluteRigTransform ()
 Returns bone's rig absolute transform - including transforms of all parent bones More...
 
MyCharacterBone GetChildBone (int childIndex)
 
override string ToString ()
 

Static Public Member Functions

static void ComputeAbsoluteTransforms (MyCharacterBone[] bones)
 Compute absolute bone transforms for whole hierarchy. Expects the array to be sorted by depth in hiearachy. More...
 
static void TranslateAllBones (MyCharacterBone[] characterBones, Vector3 translationModelSpace)
 Translate all bones. Translation vector is given in model space. We expect that absolute transforms are already computed. More...
 

Public Attributes

string Name = ""
 The bone name More...
 

Properties

int Index [get]
 
Matrix BindTransform [get]
 The bone bind transform More...
 
Matrix BindTransformInv [get]
 
Matrix SkinTransform [get, set]
 Inverse of absolute bind transform for skinnning More...
 
Quaternion Rotation [get, set]
 Bone rotation More...
 
Vector3 Translation [get, set]
 Any translations More...
 
MyCharacterBone Parent [get]
 The parent bone or null for the root bone More...
 
Matrix AbsoluteTransform [get]
 The bone absolute transform More...
 
Matrix RelativeTransform [get]
 The bone absolute transform More...
 
int Depth [get]
 

Detailed Description

Bones in this model are represented by this class, which allows a bone to have more detail associatd with it.

This class allows you to manipulate the local coordinate system for objects by changing the scaling, translation, and rotation. These are indepenent of the bind transformation originally supplied for the model. So, the actual transformation for a bone is the product of the:

Scaling Bind scaling (scaling removed from the bind transform) Rotation Translation Bind Transformation Parent Absolute Transformation

Definition at line 25 of file MyCharacterBone.cs.

Constructor & Destructor Documentation

VRageRender.Animations.MyCharacterBone.MyCharacterBone ( string  name,
MyCharacterBone  parent,
Matrix  bindTransform,
int  index,
Matrix[]  relativeStorage,
Matrix[]  absoluteStorage 
)
inline

Constructor for a bone object

Parameters
nameThe name of the bone
bindTransformThe initial bind transform for the bone
parentA parent for this bone
indexIndex of this bone in storage arrays.
relativeStoragereference to matrix array storing all relative transforms of the skeleton
absoluteStoragereference to matrix array storing all absolute transforms of the skeleton

Definition at line 154 of file MyCharacterBone.cs.

Member Function Documentation

void VRageRender.Animations.MyCharacterBone.ComputeAbsoluteTransform ( bool  propagateTransformToChildren = true)
inline

Compute the absolute transformation for this bone.

Definition at line 248 of file MyCharacterBone.cs.

static void VRageRender.Animations.MyCharacterBone.ComputeAbsoluteTransforms ( MyCharacterBone[]  bones)
inlinestatic

Compute absolute bone transforms for whole hierarchy. Expects the array to be sorted by depth in hiearachy.

Definition at line 202 of file MyCharacterBone.cs.

bool VRageRender.Animations.MyCharacterBone.ComputeBoneTransform ( )
inline

Definition at line 272 of file MyCharacterBone.cs.

Matrix VRageRender.Animations.MyCharacterBone.GetAbsoluteRigTransform ( )
inline

Returns bone's rig absolute transform - including transforms of all parent bones

Returns

Definition at line 417 of file MyCharacterBone.cs.

MyCharacterBone VRageRender.Animations.MyCharacterBone.GetChildBone ( int  childIndex)
inline

Definition at line 434 of file MyCharacterBone.cs.

void VRageRender.Animations.MyCharacterBone.GetCompleteTransform ( ref Vector3  translation,
ref Quaternion  rotation,
out Vector3  completeTranslation,
out Quaternion  completeRotation 
)
inline

Same as SetCompleteTransform, but result is not stored internally, it is returned instead.

Definition at line 381 of file MyCharacterBone.cs.

void VRageRender.Animations.MyCharacterBone.SetCompleteBindTransform ( )
inline

This sets the rotation and translation of the rest pose.

Definition at line 319 of file MyCharacterBone.cs.

void VRageRender.Animations.MyCharacterBone.SetCompleteRotation ( ref Quaternion  rotation)
inline

This adds the rotation and translation to the one that is already set inside.

Definition at line 372 of file MyCharacterBone.cs.

void VRageRender.Animations.MyCharacterBone.SetCompleteTransform ( ref Vector3  translation,
ref Quaternion  rotation,
float  weight 
)
inline

This sets the rotation and translation such that the rotation times the translation times the bind after set equals this matrix. This is used to set animation values.

Definition at line 303 of file MyCharacterBone.cs.

void VRageRender.Animations.MyCharacterBone.SetCompleteTransform ( ref Vector3  translation,
ref Quaternion  rotation 
)
inline

This sets the rotation and translation such that the rotation times the translation times the bind after set equals this matrix. This is used to set animation values.

Definition at line 332 of file MyCharacterBone.cs.

void VRageRender.Animations.MyCharacterBone.SetCompleteTransformFromAbsoluteMatrix ( ref Matrix  absoluteMatrix,
bool  onlyRotation 
)
inline

Set the rotation and translation of the bone from absolute transform. Does not recompute hierarchy - call ComputeAbsoluteTransform.

Parameters
absoluteMatrixabsolute transform
onlyRotationapply only rotation

Definition at line 344 of file MyCharacterBone.cs.

void VRageRender.Animations.MyCharacterBone.SetCompleteTransformFromAbsoluteMatrix ( Matrix  absoluteMatrix,
bool  onlyRotation 
)
inline

Set the rotation and translation of the bone from absolute transform. Does not recompute hierarchy - call ComputeAbsoluteTransform.

Parameters
absoluteMatrixabsolute transform
onlyRotationapply only rotation

Definition at line 364 of file MyCharacterBone.cs.

override string VRageRender.Animations.MyCharacterBone.ToString ( )
inline

Definition at line 441 of file MyCharacterBone.cs.

static void VRageRender.Animations.MyCharacterBone.TranslateAllBones ( MyCharacterBone[]  characterBones,
Vector3  translationModelSpace 
)
inlinestatic

Translate all bones. Translation vector is given in model space. We expect that absolute transforms are already computed.

Definition at line 228 of file MyCharacterBone.cs.

Member Data Documentation

string VRageRender.Animations.MyCharacterBone.Name = ""

The bone name

Definition at line 67 of file MyCharacterBone.cs.

Property Documentation

Matrix VRageRender.Animations.MyCharacterBone.AbsoluteTransform
get

The bone absolute transform

Definition at line 104 of file MyCharacterBone.cs.

Matrix VRageRender.Animations.MyCharacterBone.BindTransform
get

The bone bind transform

Definition at line 77 of file MyCharacterBone.cs.

Matrix VRageRender.Animations.MyCharacterBone.BindTransformInv
get

Definition at line 78 of file MyCharacterBone.cs.

int VRageRender.Animations.MyCharacterBone.Depth
get

Definition at line 136 of file MyCharacterBone.cs.

int VRageRender.Animations.MyCharacterBone.Index
get

Definition at line 69 of file MyCharacterBone.cs.

MyCharacterBone VRageRender.Animations.MyCharacterBone.Parent
get

The parent bone or null for the root bone

Definition at line 98 of file MyCharacterBone.cs.

Matrix VRageRender.Animations.MyCharacterBone.RelativeTransform
get

The bone absolute transform

Definition at line 112 of file MyCharacterBone.cs.

Quaternion VRageRender.Animations.MyCharacterBone.Rotation
getset

Bone rotation

Definition at line 88 of file MyCharacterBone.cs.

Matrix VRageRender.Animations.MyCharacterBone.SkinTransform
getset

Inverse of absolute bind transform for skinnning

Definition at line 83 of file MyCharacterBone.cs.

Vector3 VRageRender.Animations.MyCharacterBone.Translation
getset

Any translations

Definition at line 93 of file MyCharacterBone.cs.


The documentation for this class was generated from the following file: