Gorilla.HAnim.Joint
Unit Gorilla.HAnim.Joint.pasClasses
- TGorillaHAnimJoint = class ( TGorillaTransform )
Mics. types
- type TGorillaHAnimJointLocalTransform = array [0..15] of TMatrix3D;
TGorillaHAnimJoint
Ancestors
Members
Fields
- private FLocalBindTransform :
TGorillaHAnimJointLocalTransform
- private FInverseBindTransform :
TGorillaHAnimJointLocalTransform
- private FCurrentOffsetMatrix :
TGorillaHAnimJointLocalTransform
- protected FSkinned :
Boolean
- protected FShowJoint :
Boolean
- protected FJointRenderColor :
TAlphaColor
- protected FJointRenderSize :
TPoint3D
- protected FJoints :
TGorillaHAnimJointList
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetHumanoid ( ) : TGorillaTransform ;
- protected function GetLocalBindTransform ( AIndex : TControllerDef ) : TMatrix3D ; inline;
- protected procedure SetLocalBindTransform ( AIndex : TControllerDef; AValue : TMatrix3D ) ; inline;
- protected function GetInverseBindTransform ( AIndex : TControllerDef ) : TMatrix3D ; inline;
- protected procedure SetInverseBindTransform ( AIndex : TControllerDef; AValue : TMatrix3D ) ; inline;
- protected function GetCurrentOffsetMatrix ( AIndex : TControllerDef ) : TMatrix3D ; inline;
- protected procedure SetCurrentOffsetMatrix ( AIndex : TControllerDef; AValue : TMatrix3D ) ; inline;
- protected function GetShowJoint ( ) : Boolean ;
- protected procedure SetShowJoint ( const AValue : Boolean ) ;
- protected function GetJointRenderColor ( ) : TAlphaColor ;
- protected procedure SetJointRenderColor ( const AValue : TAlphaColor ) ;
- protected procedure DoRenderJoint ( AContext : TContext3D ) ; virtual;
- protected procedure Render ( ) ; override;
- protected function GetIsSkeletonRoot ( ) : Boolean ;
- protected procedure DoDuplicate
(
ASource :
TComponent; ADuplicator :
TGorillaDuplicator
)
;
override;
Duplicates a TGorillaMesh/TGorillaModel and all of its submeshes. The method copies the complete memory structure and refreshes necessary lists and standalone components
- public function GetSkeletonTransformMatrix
(
)
: TMatrix3D
;
Request the current transformation matrix to root node of skeleton. This is not the global offset, instead only to the skeleton root.
- public procedure SetLocalTransformMatrix ( const AMatrix : TMatrix3D ) ; override;
- public procedure SetLocalBindTransformMatrix ( ACtrl : TControllerDef; const AMatrix : TMatrix3D ) ; virtual;
- public procedure CalculateInverseBindTransformMatrix ( const ACtrl : TControllerDef; const AParentBindTransform : TMatrix3D ) ;
- public procedure AddJoint
(
const
AJoint :
TGorillaHAnimJoint
)
;
NOTE: To support bind shape matrices we need this dirty hack if bind shape matrix is not identity, it means we have a bind shape transformation and we need to use binding transform instead of the given inverse bind matrix
- public function FindJoint ( const ADef : TJointDef ) : TGorillaHAnimJoint ;
- public procedure ClearJoints ( ) ;
- public procedure LoadFromDefinition ( const ADef : TJointDef ) ; overload virtual;
- public procedure PrepareSkinAnimation
(
)
;
Prepares every joint once for animation
- public procedure PrepareSkinAnimationStep
(
ACtrl :
TControllerDef
)
;
Preparation of every joint at any animation frame based on the submitted skeleton transformation matrix.
- public procedure ApplyJointInfoToHumanoid
(
const
ACtrl :
TControllerDef; const
AVertices :
TVertexJointsList; AMeshDef :
TMeshDef
=
nil
)
;
Setting up the TVertexJointsList, which contains information which joint affects which vertices. at first all shape vertices were added to that TVertexJointsList. and afterwards we iterate through all joints and check what vertices they affect
- public procedure DebugOut ( const ATab : string ) ;
Properties
- public Humanoid : TGorillaTransform
- public Joints : TObjectList<Gorilla.HAnim.Joint.TGorillaHAnimJoint>
- public Skinned : Boolean
- public IsSkeletonRoot : Boolean
- public ShowJoint : Boolean
Should joints be displayed while rendering. Helpful for debugging problems with animations. Or for editing humanoid skeleton.
read GetShowJoint
write SetShowJoint - public JointRenderColor : TAlphaColor
If ShowJoint is set to true the component renders its joint visually. This property defines the color used for rendering a cube.
read GetJointRenderColor
write SetJointRenderColor - public JointRenderSize : TPoint3D
Define the joint render cube size. By default it's (0.25, 0.25, 0.25)
read FJointRenderSize
write FJointRenderSize - public LocalBindTransform[Index] : TMatrix3D
- public CurrentOffsetMatrix[Index] : TMatrix3D
At animation-time generated matrix which represents the offset between the current transformation and binding transformation
read GetCurrentOffsetMatrix