Interface to character animation
struct ICharacterInstance { };
ICryAnimation.h
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.
virtual ~ICharacterInstance();
virtual void AddRef() = 0;
Increase reference count of the interface
virtual void CopyPoseFrom(const ICharacterInstance & instance) = 0;
virtual void CreateDecal(CryEngineDecalInfo& DecalLCS) = 0;
! Spawn a decal on animated characters ! The decal hit direction and source point are in the local coordinates of the character.
virtual void EnableDecals(uint32 d) = 0;
! enable and disable decals for this instance by default its always disabled
virtual void EnableFacialAnimation(bool bEnable) = 0;
virtual void EnableProceduralFacialAnimation(bool bEnable) = 0;
virtual void EnableStartAnimation(bool bEnable) = 0;
enables/disables StartAnimation* calls; puts warning into the log if StartAnimation* is called while disabled
virtual void FinishAnimationComputations() = 0;
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
Get the bounding box
virtual const AABB& GetAABB() = 0;
! Return dynamic bbox of object
virtual float GetCustomScaleForJoint(uint32 jointIndex) const = 0;
Return the extent (length, volume, or area) of the object
virtual float GetExtent(EGeomForm eForm) = 0;
Parameters |
Description |
EGeomForm eForm |
See RandomPos |
virtual IFacialInstance* GetFacialInstance() = 0;
Facial interface.
Get the filename of the model
virtual const char* GetFilePath() = 0;
A pointer to a null terminated char string which contain the filename of the model.
Get a property attached to the model during exporting process.
Set rendering flags
virtual int GetFlags() = 0;
Return an integer value which hold the different rendering flags
Get the rendering flags enabled. The valid flags are the ones declared in ECharRenderFlags.
Get the Animation Set defined for the model
virtual IAnimationSet* GetIAnimationSet() = 0;
A pointer to a ICryAnimationSet derived class
Return a pointer of the instance of a ICryAnimationSet derived class applicable for the model.
Get the attachment manager for this instance
virtual IAttachmentManager* GetIAttachmentManager() = 0;
A pointer to a IAttachmentManager derived class
Return a pointer of the instance of a IAttachmentManager derived class applicable for the model.
virtual IDefaultSkeleton& GetIDefaultSkeleton() const = 0;
Return shared character model used by this instance.
virtual bool GetIgnoreScaleForJoint(uint32 jointIndex) const = 0;
virtual IMaterial* GetIMaterial() const = 0;
Parameters |
Description |
nType |
Pass 0 to get the physic geometry or pass 1 to get the obstruct geometry |
A pointer to a phys_geometry class.
Returns material used to render this character, can be either custom or model material.
virtual IMaterial* GetIMaterial_Instance() const = 0;
A pointer to the material, or 0.
Returns the instance-specific material - if this is 0, then the default model material is in use.
virtual bool GetIsCustomScaleForJoint(uint32 jointIndex) const = 0;
Get the skeleton for this instance
virtual ISkeletonAnim* GetISkeletonAnim() = 0;
A pointer to a ISkeletonAnim derived class
Return a pointer of the instance of a ISkeletonAnim derived class applicable for the model.
Get the skeleton for this instance
virtual ISkeletonPose* GetISkeletonPose() = 0;
A pointer to a ISkeletonPose derived class
Return a pointer of the instance of a ISkeletonPose derived class applicable for the model.
virtual void GetMemoryUsage(class ICrySizer* pSizer) const = 0;
! Pushes the underlying tree of objects into the given Sizer object for statistics gathering
Get the animation event file
virtual const char* GetModelAnimEventDatabase() = 0;
A pointer to a null terminated char string which contains the filename of the database
Get the name of the file that stores the animation event definitions for this model. This is usually stored in the CAL file
Get the object type
virtual int GetOjectType() = 0;
An object type constant
Get the object type contained inside the character instance. It will return either the CHR or CGA constant.
virtual f32 GetPlaybackScale() = 0;
Get the radius of the object, squared
virtual float GetRadiusSqr() = 0;
! Return the radius of the object, squared
Generate a random point in object.
Parameters |
Description |
EGeomForm eForm |
Object aspect to generate on (surface, volume, etc) |
virtual int GetRefCount() const = 0;
Query current reference count
virtual float GetUniformScale() const = 0;
virtual bool HasVertexAnimation() const = 0;
virtual void HideMaster(uint32 h) = 0;
! disable rendering of this render this instance
virtual uint32 IsCharacterVisible() = 0;
virtual void KillAllSkeletonEffects() = 0;
virtual void LipSyncWithSound(uint32 nSoundId, bool bStop = false) = 0;
Lip sync character with the played sound.
virtual void OnDetach() = 0;
! is called when the character is detached (if it was an attachment)
virtual void ProcessAttachment(IAttachment* pIAttachment) = 0;
virtual void Release() = 0;
Decrease reference count of the interface
Draw the character
virtual void Render(const SRendParams& RendParams, const QuatTS& Offset, const SRenderingPassInfo & passInfo, bool* updated = 0) = 0;
Parameters |
Description |
const SRendParams& RendParams |
Rendering parameters |
Draw the character using specified rendering parameters.
virtual void Serialize(TSerialize ser) = 0;
virtual void SetAttachmentLocation_DEPRECATED(const QuatTS& newCharacterLocation) = 0;
this is a hack to keep entity attachments in synch. @Sven & IvoF: please provide a clean solution
virtual void SetCustomScaleForJoint(uint32 jointIndex, bool bValue, float fValue) = 0;
Set rendering flags
virtual void SetFlags(int nFlags) = 0;
Set rendering flags defined in ECharRenderFlags for this character instance
virtual void SetIMaterial_Instance(IMaterial * pMaterial) = 0;
Parameters |
Description |
IMaterial * pMaterial |
A valid pointer to the material. |
Set custom instance material for this character.
virtual void SetPlaybackScale(f32 fSpeed) = 0;
! 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.
virtual void SetUniformScale(const float& fUniformScale) = 0;
virtual void SetViewdir(const Vec3& rViewdir) = 0;
virtual void SpawnSkeletonEffect(int animID, const char* animName, const char* effectName, const char* boneName, const Vec3& offset, const Vec3& dir, const QuatTS& entityLoc) = 0;
Skeleton effects interface.
virtual void StartAnimationProcessing(const SAnimationProcessParams& params) = 0;