Main interface to handle low-level animation processing on a character instance. More...
#include
Public Member Functions | |
virtual void | SetDebugging (uint32 flags)=0 |
Enable special debug text for this skeleton. | |
virtual void | SetMirrorAnimation (uint32 ts)=0 |
virtual void | SetAnimationDrivenMotion (uint32 ts)=0 |
virtual uint32 | GetAnimationDrivenMotion () const =0 |
virtual void | SetTrackViewExclusive (uint32 i)=0 |
virtual void | SetTrackViewMixingWeight (uint32 layer, f32 weight)=0 |
virtual uint32 | GetTrackViewStatus () const =0 |
virtual bool | StartAnimation (const char *szAnimName0, const CryCharAnimationParams ¶ms)=0 |
virtual bool | StartAnimationById (int32 id, const CryCharAnimationParams &Params)=0 |
virtual bool | StopAnimationInLayer (int32 nLayer, f32 BlendOutTime)=0 |
Stops playback of the current animation in the specified layer, and specifies the time during which we will blend out. | |
virtual bool | StopAnimationsAllLayers ()=0 |
Seizes playback of animations in all layers. | |
virtual CAnimation * | FindAnimInFIFO (uint32 nUserToken, int nLayer=1)=0 |
virtual const CAnimation * | FindAnimInFIFO (uint32 nUserToken, int nLayer=1) const =0 |
virtual bool | RemoveAnimFromFIFO (uint32 nLayer, uint32 num, bool forceRemove=false)=0 |
virtual int | GetNumAnimsInFIFO (uint32 nLayer) const =0 |
virtual void | ClearFIFOLayer (uint32 nLayer)=0 |
virtual CAnimation & | GetAnimFromFIFO (uint32 nLayer, uint32 num)=0 |
virtual const CAnimation & | GetAnimFromFIFO (uint32 nLayer, uint32 num) const =0 |
virtual void | ManualSeekAnimationInFIFO (uint32 nLayer, uint32 num, float time, bool triggerAnimEvents)=0 |
If manual update is set for anim, then set anim time and handle anim events. | |
virtual void | RemoveTransitionDelayConditions (uint32 nLayer)=0 |
virtual void | SetLayerBlendWeight (int32 nLayer, f32 fMult)=0 |
virtual void | SetLayerPlaybackScale (int32 nLayer, f32 fSpeed)=0 |
virtual f32 | GetLayerPlaybackScale (uint32 nLayer) const =0 |
virtual void | SetDesiredMotionParam (EMotionParamID id, f32 value, f32 frametime)=0 |
virtual bool | GetDesiredMotionParam (EMotionParamID id, float &value) const =0 |
virtual void | SetAnimationNormalizedTime (CAnimation *pAnimation, f32 normalizedTime, bool entireClip=true)=0 |
virtual f32 | GetAnimationNormalizedTime (const CAnimation *pAnimation) const =0 |
Get the animation normalized time for the specified running animation. The return value is in the range [0..1]. | |
virtual void | SetLayerNormalizedTime (uint32 layer, f32 normalizedTime)=0 |
virtual f32 | GetLayerNormalizedTime (uint32 layer) const =0 |
virtual f32 | CalculateCompleteBlendSpaceDuration (const CAnimation &rAnimation) const =0 |
virtual Vec3 | GetCurrentVelocity () const =0 |
virtual void | SetEventCallback (CallBackFuncType func, void *pdata)=0 |
virtual AnimEventInstance | GetLastAnimEvent ()=0 |
virtual const QuatT & | GetRelMovement () const =0 |
virtual f32 | GetUserData (int i) const =0 |
virtual bool | PushPoseModifier (uint32 layer, IAnimationPoseModifierPtr poseModifier, const char *name=NULL)=0 |
Pushes a pose modifier into the specified layer, ensuring that it will be executed next frame. | |
virtual IAnimationPoseModifierSetupPtr | GetPoseModifierSetup ()=0 |
virtual IAnimationPoseModifierSetupConstPtr | GetPoseModifierSetup () const =0 |
virtual QuatT | CalculateRelativeMovement (const float deltaTime, const bool CurrNext=0) const =0 |
This function will move outside of this interface. Use at your own risk. | |
Main interface to handle low-level animation processing on a character instance.
|
pure virtual |
Calculates duration of blend space up to the point where it starts to repeat, that is a Least Common Multiple of a number of segments of different examples. For instance, if segments of caf1: A B C, caf2: 1 2. The whole duration will be calculated for sequence A1 B2 C1 A2 B1 C2.
|
pure virtual |
Find an animation with a given user token.
nUserToken | User token that identifies an animation to search for. |
nLayer | Layer of FIFO where to search for animation, if -1 all layers are searched. |
|
pure virtual |
|
pure virtual |
Remove an animation with a given index and given layer.
nLayer | Animation layer to remove from. |
num | Transition queue index to remove at. |
forceRemove | Ignore special conditions and force a removal from the layer. |
|
pure virtual |
Makes sure there's no anim in this layer's queue that could cause a delay (useful when you want to play an animation that you want to be 100% sure is going to be transitioned to immediately).
|
pure virtual |
Set the time for the specified running animation to a value in the range [0..1]. When entireClip is true, set the animation normalized time. When entireClip is false, set the current segment normalized time.
|
pure virtual |
Updates the given motion parameter in order to select / blend between animations in blend spaces. Will perform clamping and clearing as needed.
#include
void SetBlendSpaceParameter(ICharacterInstance& character)
{
// Specify which parameter to override, for the sake of this example we opt for travel speed
// These parameters can also be seen in the Character Tool
const EMotionParamID parameterId = eMotionParamID_TravelSpeed;
// Specify the value we want to set the parameter to
const float newValue = 5.f;
// Now set the motion parameter, affecting compatible blend spaces starting with the next frame.
character.GetISkeletonAnim()->SetDesiredMotionParam(parameterId, newValue, 0.f);
}
|
pure virtual |
Starts playing back the specified animation in the layer specified in the provided parameters.
szAnimName0 | Name of the animation we want to play back, without the .caf or .i_caf suffixes. |
params | Parameters that describe how the animation should be started, such as playback speed. |
#include
void StartAnimation(ICharacterInstance* pCharacter)
{
// Start an animation named "MyAnimation" (it should be visible with the same name in the Character Tool)
const char* szAnimationName = "MyAnimation";
// Loop the animation at normal speed
CryCharAnimationParams animationParams;
animationParams.m_nFlags = CA_LOOPED;
// Start playing back the animation
pCharacter->GetISkeletonAnim()->StartAnimation(szAnimationName, animationParams);
}
|
pure virtual |
Starts playing back the specified animation in the layer specified in the provided parameters.
id | Unique animation identifier, useful to avoid looking up animation by name on every playback |
params | Parameters that describe how the animation should be started, such as playback speed. |