ISkeletonPose

Represents the current pose of a character instance, allowing retrieval of the latest animation pose. More...

#include

Inherits ISkeletonPhysics.

Public Member Functions

virtual const QuatT & GetAbsJointByID (int32 nJointID) const =0
virtual const QuatT & GetRelJointByID (int32 nJointID) const =0
virtual Diag33 GetAbsJointScalingByID (int32 jointId) const =0
virtual Diag33 GetRelJointScalingByID (int32 jointId) const =0
virtual void SetPostProcessCallback (int(*func)(ICharacterInstance *, void *), void *pdata)=0
virtual void SetForceSkeletonUpdate (int32 numFrames)=0
virtual void SetDefaultPose ()=0
virtual void SetStatObjOnJoint (int32 nId, IStatObj *pStatObj)=0
virtual IStatObj * GetStatObjOnJoint (int32 nId)=0
virtual const IStatObj * GetStatObjOnJoint (int32 nId) const =0
virtual void SetMaterialOnJoint (int32 nId, IMaterial *pMaterial)=0
virtual IMaterial * GetMaterialOnJoint (int32 nId)=0
virtual const IMaterial * GetMaterialOnJoint (int32 nId) const =0
virtual void DrawSkeleton (const Matrix34 &rRenderMat34, uint32 shift=0)=0
virtual IAnimationPoseBlenderDir * GetIPoseBlenderAim ()=0
virtual const IAnimationPoseBlenderDir * GetIPoseBlenderAim () const =0
virtual IAnimationPoseBlenderDir * GetIPoseBlenderLook ()=0
virtual const IAnimationPoseBlenderDir * GetIPoseBlenderLook () const =0
virtual void ApplyRecoilAnimation (f32 fDuration, f32 fKinematicImpact, f32 fKickIn, uint32 arms=3)=0
virtual uint32 SetHumanLimbIK (const Vec3 &wgoal, const char *limb)=0
- Public Member Functions inherited from ISkeletonPhysics
virtual void BuildPhysicalEntity (IPhysicalEntity *pent, f32 mass, int surface_idx, f32 stiffness_scale=1.0f, int nLod=0, int partid0=-1, const Matrix34 &mtxloc=Matrix34(IDENTITY))=0
virtual IPhysicalEntity * CreateCharacterPhysics (IPhysicalEntity *pHost, f32 mass, int surface_idx, f32 stiffness_scale, int nLod=0, const Matrix34 &mtxloc=Matrix34(IDENTITY))=0
virtual int CreateAuxilaryPhysics (IPhysicalEntity *pHost, const Matrix34 &mtx, int nLod=0)=0
virtual IPhysicalEntity * GetCharacterPhysics () const =0
virtual IPhysicalEntity * GetCharacterPhysics (const char *pRootBoneName) const =0
virtual IPhysicalEntity * GetCharacterPhysics (int iAuxPhys) const =0
virtual void SetCharacterPhysics (IPhysicalEntity *pent)=0
virtual void SynchronizeWithPhysicalEntity (IPhysicalEntity *pent, const Vec3 &posMaster=Vec3(ZERO), const Quat &qMaster=Quat(1, 0, 0, 0))=0
virtual IPhysicalEntity * RelinquishCharacterPhysics (const Matrix34 &mtx, f32 stiffness=0.0f, bool bCopyJointVelocities=false, const Vec3 &velHost=Vec3(ZERO))=0
virtual void DestroyCharacterPhysics (int iMode=0)=0
virtual bool AddImpact (int partid, Vec3 point, Vec3 impact)=0
virtual int TranslatePartIdToDeadBody (int partid)=0
virtual int GetAuxPhysicsBoneId (int iAuxPhys, int iBone=0) const =0
virtual bool BlendFromRagdoll (QuatTS &location, IPhysicalEntity *&pPhysicalEntity, bool b3dof)=0
virtual int GetFallingDir () const =0
virtual int getBonePhysParentOrSelfIndex (int nBoneIndex, int nLod=0) const =0
virtual int GetBoneSurfaceTypeId (int nBoneIndex, int nLod=0) const =0
virtual IPhysicalEntity * GetPhysEntOnJoint (int32 nId)=0
virtual const IPhysicalEntity * GetPhysEntOnJoint (int32 nId) const =0
virtual void SetPhysEntOnJoint (int32 nId, IPhysicalEntity *pPhysEnt)=0
virtual int GetPhysIdOnJoint (int32 nId) const =0
virtual DynArray< SJointProperty > GetJointPhysProperties_ROPE (uint32 jointIndex, int nLod) const =0
virtual bool SetJointPhysProperties_ROPE (uint32 jointIndex, int nLod, const DynArray< SJointProperty > &props)=0

Static Public Attributes

static const int32 kForceSkeletonUpdatesInfinitely = 0x8000

Detailed Description

Represents the current pose of a character instance, allowing retrieval of the latest animation pose.

Member Function Documentation

◆ GetAbsJointByID()

virtual const QuatT& ISkeletonPose::GetAbsJointByID ( int32 nJointID) const
pure virtual

Retrieves location of the specified joint in model-space. The location is in the runtime pose, not the default pose. To get the location in the default pose, retrieve it from ICharacterInstance::GetIDefaultSkeleton.

This function is safe to call while the animation job is running; if you do so it will simply return the previous frame's data. New data is returned only after the job has been synchronized (ICharacterInstance::FinishAnimationComputations has been called, or we are in the PostProcess callback).

Parameters
nJointID.Behavior is undefined when the nJointID is invalid.
Returns
Model-space location of the specified joint.
See also
ISkeletonPose::SetPostProcessCallback
ISkeletonPose::GetRelJointByID
ICharacterInstance::FinishAnimationComputations
#include 

// Basic example of how the absolute joint orientation can be retrieved from a character's current pose
void GetJointOrientation(ICharacterInstance& character)
{
    // Get the default skeleton, a read-only construct in which we can get joint identifiers from names
    const IDefaultSkeleton& defaultSkeleton = character.GetIDefaultSkeleton();
    // Get the internal identifier of our joint, labeled in the DCC (Max / Maya for example)
    const int32 jointId = defaultSkeleton.GetJointIDByName("Bip 01 Head");

    // Get the orientation of the joint in world coordinates
    const QuatT& jointOrientation = character.GetISkeletonPose()->GetAbsJointByID(jointId);
    // jointOrientation.q contains a quaternion with the world-space rotation of the joint
    const Quat& jointRotation = jointOrientation.q;
    // jointOrientation.t contains a vector with the world-space position of the joint
    const Vec3& jointPosition = jointOrientation.t;
}

◆ GetIPoseBlenderAim() [1/2]

virtual IAnimationPoseBlenderDir* ISkeletonPose::GetIPoseBlenderAim ( )
pure virtual

Gets the pose modifier used to target gun aiming at a specific world coordinate

Example (Aim-IK)
#include
// Example for how to make the character aim at a specific position
void SetAimInverseKinematicsTarget(ICharacterInstance& character, const Vec3& targetWorldPosition)
{
// Query the pose blender aim interface
if (IAnimationPoseBlenderDir* pPoseBlenderAim = character.GetISkeletonPose()->GetIPoseBlenderAim())
{
// Enable the Aim-IK
pPoseBlenderAim->SetState(true);
// Make Aim-IK operate on the second animation layer
pPoseBlenderAim->SetLayer(1);
// Indicate the position we want to aim at
pPoseBlenderAim->SetTarget(targetWorldPosition);
}
}

◆ GetIPoseBlenderAim() [2/2]

virtual const IAnimationPoseBlenderDir* ISkeletonPose::GetIPoseBlenderAim ( ) const
pure virtual

Gets the pose modifier used to target gun aiming at a specific world coordinate

Example (Aim-IK)
#include
// Example for how to make the character aim at a specific position
void SetAimInverseKinematicsTarget(ICharacterInstance& character, const Vec3& targetWorldPosition)
{
// Query the pose blender aim interface
if (IAnimationPoseBlenderDir* pPoseBlenderAim = character.GetISkeletonPose()->GetIPoseBlenderAim())
{
// Enable the Aim-IK
pPoseBlenderAim->SetState(true);
// Make Aim-IK operate on the second animation layer
pPoseBlenderAim->SetLayer(1);
// Indicate the position we want to aim at
pPoseBlenderAim->SetTarget(targetWorldPosition);
}
}

◆ GetIPoseBlenderLook() [1/2]

virtual IAnimationPoseBlenderDir* ISkeletonPose::GetIPoseBlenderLook ( )
pure virtual

Gets the pose modifier used to target look aim at a specific world coordinate

Example (Look-IK)
#include
// Example for how to make the character look at a specific position
void SetLookInverseKinematicsTarget(ICharacterInstance& character, const Vec3& targetWorldPosition)
{
// Query the pose blender look interface
if (IAnimationPoseBlenderDir* pPoseBlenderLook = character.GetISkeletonPose()->GetIPoseBlenderLook())
{
// Enable the Look-IK
pPoseBlenderLook->SetState(true);
// Make Look-IK operate on the second animation layer
pPoseBlenderLook->SetLayer(1);
// Indicate the position we want to look at
pPoseBlenderLook->SetTarget(targetWorldPosition);
}
}

◆ GetIPoseBlenderLook() [2/2]

virtual const IAnimationPoseBlenderDir* ISkeletonPose::GetIPoseBlenderLook ( ) const
pure virtual

Gets the pose modifier used to target look aim at a specific world coordinate

Example (Look-IK)
#include
// Example for how to make the character look at a specific position
void SetLookInverseKinematicsTarget(ICharacterInstance& character, const Vec3& targetWorldPosition)
{
// Query the pose blender look interface
if (IAnimationPoseBlenderDir* pPoseBlenderLook = character.GetISkeletonPose()->GetIPoseBlenderLook())
{
// Enable the Look-IK
pPoseBlenderLook->SetState(true);
// Make Look-IK operate on the second animation layer
pPoseBlenderLook->SetLayer(1);
// Indicate the position we want to look at
pPoseBlenderLook->SetTarget(targetWorldPosition);
}
}

◆ GetRelJointByID()

virtual const QuatT& ISkeletonPose::GetRelJointByID ( int32 nJointID) const
pure virtual

Retrieves location of the specified joint in parent-joint space. The location is in the runtime pose, not the default pose. To get the location in the default pose, retrieve it from ICharacterInstance::GetIDefaultSkeleton.

This function is safe to call while the animation job is running; if you do so it will simply return the previous frame's data. New data is returned only after the job has been synchronized (ICharacterInstance::FinishAnimationComputations has been called, or we are in the PostProcess callback).

Parameters
nJointID.Behavior is undefined when the nJointID is invalid.
Returns
Parent-joint space location of the specified joint.
See also
ISkeletonPose::SetPostProcessCallback
ISkeletonPose::GetAbsJointByID
ICharacterInstance::FinishAnimationComputations

◆ SetForceSkeletonUpdate()

virtual void ISkeletonPose::SetForceSkeletonUpdate ( int32 numFrames)
pure virtual

Force updates of the skeleton pose (even when invisible). Note that this is not recommended. If possible use CA_FORCE_SKELETON_UPDATE when starting animations that need an update.

Parameters
numFramesNumber of frames to force the update. Use ISkeletonPose::kForceSkeletonUpdatesInfinitely to force it on all the time.
See also
CA_FORCE_SKELETON_UPDATE