Anim::AnimatedCreature class

Public static functions

static auto IsIdleWalkLookatStart(uint32_t animID) -> bool
static auto IsIdleWalkStop(uint32_t animID) -> bool
static auto IsIdleWalk(uint32_t animID) -> bool

Constructors, destructors, conversion operators

~AnimatedCreature() virtual

Public functions

auto func00h(int, bool) -> int pure virtual
auto PlayAnimation(uint32_t animID, int* pChoice = nullptr) -> AnimIndex pure virtual
Plays an animation, this is the same as calling LoadAnimation() and StartAnimation().
auto LoadAnimation(uint32_t animID, int* pChoice = nullptr) -> AnimIndex pure virtual
Loads an animation to be used by this creature.
auto SetAnimationMode(AnimIndex index, int mode) -> bool pure virtual
auto SetAnimationIdle(AnimIndex index, bool idle) -> bool pure virtual
auto SetAnimationBlendInTime(AnimIndex index, float blendInTime) -> bool pure virtual
auto StartAnimation(AnimIndex index) -> bool pure virtual
auto func1Ch(AnimIndex index, float) -> bool pure virtual
auto SetLoop(AnimIndex index, bool loop) -> bool pure virtual
Enables or disables looping in this animation, which is repating the animation once it ends playing.
auto SetLoopTimes(AnimIndex index, float loopTimes = -1.0f) -> bool pure virtual
Sets how many times the animation is played.
auto func28h(AnimIndex index, float) -> bool pure virtual
auto func2Ch(AnimIndex index, float) -> bool pure virtual
auto func30h(AnimIndex index, float) -> bool pure virtual
auto func34h(AnimIndex index, float) -> bool pure virtual
auto func38h(AnimIndex index, float) -> bool pure virtual
auto func3Ch(AnimIndex index, int) -> bool pure virtual
auto SetAnimationID(AnimIndex index, uint32_t animID) -> bool pure virtual
auto func44h(AnimIndex index, float) -> bool pure virtual
auto func48h(AnimIndex index, int) -> bool pure virtual
auto func4Ch(AnimIndex index, int, int) -> bool pure virtual
auto func50h() -> int pure virtual
auto func54h() -> int pure virtual
auto GetCurrentAnimation(uint32_t* dstAnimID, float* dstTime = nullptr, int* = nullptr, AnimIndex* dstAnimIndex = nullptr) -> int pure virtual
auto func5Ch(AnimIndex index, float*, float*) -> bool pure virtual
auto GetAnimationLength(uint32_t animID) -> float pure virtual
auto func64h() -> int pure virtual
auto func68h() -> int pure virtual
auto func6Ch() -> int pure virtual
auto GetAnimWorld() -> Graphics::IModelWorld* pure virtual
auto func74h() -> int pure virtual
auto func78h() -> int pure virtual
auto AddRef() -> int
auto Release() -> int
auto GetModel() -> Graphics::Model*

Public variables

Vector3 mPosition
Quaternion mOrientation
char padding_20
int field_154
int field_158
int field_15C
int field_160
Vector3 field_164
int field_170
anim_cid* p_cid
ModelPtr mpModel
int field_184
int field_188
AnimIndex field_18C
IAnimWorld* mpAnimWorld
int field_194
int mnRefCount

Function documentation

AnimIndex Anim::AnimatedCreature::PlayAnimation(uint32_t animID, int* pChoice = nullptr) pure virtual

Plays an animation, this is the same as calling LoadAnimation() and StartAnimation().

Parameters
animID The ID of the animation to play, a TLSA group.
pChoice in/out [Optional] The selected animation choice index will be written here. If initial value is not -1, it will be used to force a certain choice.
Returns Index of animation, that can be used in other operations.

AnimIndex Anim::AnimatedCreature::LoadAnimation(uint32_t animID, int* pChoice = nullptr) pure virtual

Loads an animation to be used by this creature.

Parameters
animID The ID of the animation to play, a TLSA group.
pChoice in/out [Optional] The selected animation choice index will be written here. If initial value is not -1, it will be used to force a certain choice.
Returns Index of animation, that can be used in other operations.

It takes the ID of a TLSA group. It returns an index that is used to identify the animation within this creature.

TLSA Animation groups can specify multiple animation choices with different probabilities. The pChoice argument can be provided to force a certain choice index; if the value is -1, the argument will be used as an ooutput to know what choice has been selected.

bool Anim::AnimatedCreature::StartAnimation(AnimIndex index) pure virtual

Parameters
index Index of the animation

bool Anim::AnimatedCreature::SetLoop(AnimIndex index, bool loop) pure virtual

Enables or disables looping in this animation, which is repating the animation once it ends playing.

Parameters
index Index of the animation
loop If true, the animation will repeat when it finishes.

SetLoopTimes() must also be called to set how many times the animation is looped, setting it to -1 loops it indefinitely.

bool Anim::AnimatedCreature::SetLoopTimes(AnimIndex index, float loopTimes = -1.0f) pure virtual

Sets how many times the animation is played.

Parameters
index Index of the animation
loopTimes How many times the animation is played. You can use decimals to only play a portion the last time.

The number does not need to be integer: for example, setting it to 0.5 will play half the animation. Numbers above 1 will only be used if looping is enabled for this animation (SetLoop()). Setting it to -1 repeats it indefinitely.