ICharacterInstance

Interface to character animation

C++
struct ICharacterInstance {
};
File

ICryAnimation.h

Description

This interface contains methods for manipulating and querying an animated character Instance. The methods allow modify the animated instance to the certain way, animate it, render, retrieve BBox/etc, control physics, particles and skinning, transform.

ICharacterInstance::~ICharacterInstance Destructor
C++
virtual ~ICharacterInstance();
ICharacterInstance::AddRef Method
C++
virtual void AddRef() = 0;
Description

Increase reference count of the interface

ICharacterInstance::CopyPoseFrom Method
C++
virtual void CopyPoseFrom(const ICharacterInstance & instance) = 0;
ICharacterInstance::CreateDecal Method
C++
virtual void CreateDecal(CryEngineDecalInfo& DecalLCS) = 0;
Description

! Spawn a decal on animated characters ! The decal hit direction and source point are in the local coordinates of the character.

ICharacterInstance::EnableDecals Method
C++
virtual void EnableDecals(uint32 d) = 0;
Description

! enable and disable decals for this instance by default its always disabled

ICharacterInstance::EnableFacialAnimation Method
C++
virtual void EnableFacialAnimation(bool bEnable) = 0;
ICharacterInstance::EnableProceduralFacialAnimation Method
C++
virtual void EnableProceduralFacialAnimation(bool bEnable) = 0;
ICharacterInstance::EnableStartAnimation Method
C++
virtual void EnableStartAnimation(bool bEnable) = 0;
Description

enables/disables StartAnimation* calls; puts warning into the log if StartAnimation* is called while disabled

ICharacterInstance::FinishAnimationComputations Method
C++
virtual void FinishAnimationComputations() = 0;
Description

Makes sure all functions which must be called after forward kinematics are executed and also synchronizes the execution Is called during GetISkeletonAnim and GetISkeletonPose if the bNeedSync flag is set to true(the default) to ensure all computations have finished when needed

ICharacterInstance::GetAABB Method

Get the bounding box

C++
virtual const AABB& GetAABB() = 0;
Description

! Return dynamic bbox of object

ICharacterInstance::GetCustomScaleForJoint Method
C++
virtual float GetCustomScaleForJoint(uint32 jointIndex) const = 0;
ICharacterInstance::GetExtent Method

Return the extent (length, volume, or area) of the object

C++
virtual float GetExtent(EGeomForm eForm) = 0;
Parameters
Parameters
Description
EGeomForm eForm
See RandomPos
ICharacterInstance::GetFacialInstance Method
C++
virtual IFacialInstance* GetFacialInstance() = 0;
Description

Facial interface.

ICharacterInstance::GetFilePath Method

Get the filename of the model

C++
virtual const char* GetFilePath() = 0;
Returns

A pointer to a null terminated char string which contain the filename of the model.

Description

Get a property attached to the model during exporting process.

ICharacterInstance::GetFlags Method

Set rendering flags

C++
virtual int GetFlags() = 0;
Returns

Return an integer value which hold the different rendering flags

Description

Get the rendering flags enabled. The valid flags are the ones declared in ECharRenderFlags.

ICharacterInstance::GetIAnimationSet Method

Get the Animation Set defined for the model

C++
virtual IAnimationSet* GetIAnimationSet() = 0;
Returns

A pointer to a ICryAnimationSet derived class

Description

Return a pointer of the instance of a ICryAnimationSet derived class applicable for the model.

ICharacterInstance::GetIAttachmentManager Method

Get the attachment manager for this instance

C++
virtual IAttachmentManager* GetIAttachmentManager() = 0;
Returns

A pointer to a IAttachmentManager derived class

Description

Return a pointer of the instance of a IAttachmentManager derived class applicable for the model.

ICharacterInstance::GetIDefaultSkeleton Method
C++
virtual IDefaultSkeleton& GetIDefaultSkeleton() const = 0;
Description

Return shared character model used by this instance.

ICharacterInstance::GetIgnoreScaleForJoint Method
C++
virtual bool GetIgnoreScaleForJoint(uint32 jointIndex) const = 0;
ICharacterInstance::GetIMaterial Method
C++
virtual IMaterial* GetIMaterial() const = 0;
Parameters
Parameters
Description
nType
Pass 0 to get the physic geometry or pass 1 to get the obstruct geometry
Returns

A pointer to a phys_geometry class.

Description

Returns material used to render this character, can be either custom or model material.

ICharacterInstance::GetIMaterial_Instance Method
C++
virtual IMaterial* GetIMaterial_Instance() const = 0;
Returns

A pointer to the material, or 0.

Description

Returns the instance-specific material - if this is 0, then the default model material is in use.

ICharacterInstance::GetIsCustomScaleForJoint Method
C++
virtual bool GetIsCustomScaleForJoint(uint32 jointIndex) const = 0;
ICharacterInstance::GetISkeletonAnim Method

Get the skeleton for this instance

C++
virtual ISkeletonAnim* GetISkeletonAnim() = 0;
Returns

A pointer to a ISkeletonAnim derived class

Description

Return a pointer of the instance of a ISkeletonAnim derived class applicable for the model.

ICharacterInstance::GetISkeletonPose Method

Get the skeleton for this instance

C++
virtual ISkeletonPose* GetISkeletonPose() = 0;
Returns

A pointer to a ISkeletonPose derived class

Description

Return a pointer of the instance of a ISkeletonPose derived class applicable for the model.

ICharacterInstance::GetMemoryUsage Method
C++
virtual void GetMemoryUsage(class ICrySizer* pSizer) const = 0;
Description

! Pushes the underlying tree of objects into the given Sizer object for statistics gathering

ICharacterInstance::GetModelAnimEventDatabase Method

Get the animation event file

C++
virtual const char* GetModelAnimEventDatabase() = 0;
Returns

A pointer to a null terminated char string which contains the filename of the database

Description

Get the name of the file that stores the animation event definitions for this model. This is usually stored in the CAL file

ICharacterInstance::GetOjectType Method

Get the object type

C++
virtual int GetOjectType() = 0;
Returns

An object type constant

Description

Get the object type contained inside the character instance. It will return either the CHR or CGA constant.

ICharacterInstance::GetPlaybackScale Method
C++
virtual f32 GetPlaybackScale() = 0;
ICharacterInstance::GetRadiusSqr Method

Get the radius of the object, squared

C++
virtual float GetRadiusSqr() = 0;
Description

! Return the radius of the object, squared

ICharacterInstance::GetRandomPos Method

Generate a random point in object.

C++
virtual void GetRandomPos(PosNorm& ran, EGeomForm eForm) = 0;
Parameters
Parameters
Description
EGeomForm eForm
Object aspect to generate on (surface, volume, etc)
ICharacterInstance::GetRefCount Method
C++
virtual int GetRefCount() const = 0;
Description

Query current reference count

ICharacterInstance::GetUniformScale Method
C++
virtual float GetUniformScale() const = 0;
ICharacterInstance::HasVertexAnimation Method
C++
virtual bool HasVertexAnimation() const = 0;
ICharacterInstance::HideMaster Method
C++
virtual void HideMaster(uint32 h) = 0;
Description

! disable rendering of this render this instance

ICharacterInstance::IsCharacterVisible Method
C++
virtual uint32 IsCharacterVisible() = 0;
ICharacterInstance::KillAllSkeletonEffects Method
C++
virtual void KillAllSkeletonEffects() = 0;
ICharacterInstance::LipSyncWithSound Method
C++
virtual void LipSyncWithSound(uint32 nSoundId, bool bStop = false) = 0;
Description

Lip sync character with the played sound.

ICharacterInstance::OnDetach Method
C++
virtual void OnDetach() = 0;
Description

! is called when the character is detached (if it was an attachment)

ICharacterInstance::ProcessAttachment Method
C++
virtual void ProcessAttachment(IAttachment* pIAttachment) = 0;
ICharacterInstance::Release Method
C++
virtual void Release() = 0;
Description

Decrease reference count of the interface

ICharacterInstance::Render Method

Draw the character

C++
virtual void Render(const SRendParams& RendParams, const QuatTS& Offset, const SRenderingPassInfo & passInfo, bool* updated = 0) = 0;
Parameters
Parameters
Description
const SRendParams& RendParams
Rendering parameters
Description

Draw the character using specified rendering parameters.

ICharacterInstance::Serialize Method
C++
virtual void Serialize(TSerialize ser) = 0;
ICharacterInstance::SetAttachmentLocation_DEPRECATED Method
C++
virtual void SetAttachmentLocation_DEPRECATED(const QuatTS& newCharacterLocation) = 0;
Description

this is a hack to keep entity attachments in synch. @Sven & IvoF: please provide a clean solution

ICharacterInstance::SetCustomScaleForJoint Method
C++
virtual void SetCustomScaleForJoint(uint32 jointIndex, bool bValue, float fValue) = 0;
ICharacterInstance::SetFlags Method

Set rendering flags

C++
virtual void SetFlags(int nFlags) = 0;
Description

Set rendering flags defined in ECharRenderFlags for this character instance

ICharacterInstance::SetIMaterial_Instance Method
C++
virtual void SetIMaterial_Instance(IMaterial * pMaterial) = 0;
Parameters
Parameters
Description
IMaterial * pMaterial
A valid pointer to the material.
Description

Set custom instance material for this character.

ICharacterInstance::SetPlaybackScale Method
C++
virtual void SetPlaybackScale(f32 fSpeed) = 0;
Description

! Set animations speed scale ! This is the scale factor that affects the animation speed of the character. ! All the animations are played with the constant real-time speed multiplied by this factor. ! So, 0 means still animations (stuck at some frame), 1 - normal, 2 - twice as fast, 0.5 - twice slower than normal.

ICharacterInstance::SetUniformScale Method
C++
virtual void SetUniformScale(const float& fUniformScale) = 0;
ICharacterInstance::SetViewdir Method
C++
virtual void SetViewdir(const Vec3& rViewdir) = 0;
ICharacterInstance::SpawnSkeletonEffect Method
C++
virtual void SpawnSkeletonEffect(int animID, const char* animName, const char* effectName, const char* boneName, const Vec3& offset, const Vec3& dir, const QuatTS& entityLoc) = 0;
Description

Skeleton effects interface.

ICharacterInstance::StartAnimationProcessing Method
C++
virtual void StartAnimationProcessing(const SAnimationProcessParams& params) = 0;