Turok
 
Loading...
Searching...
No Matches
kAnimState Class Reference

Public Member Functions

void Blend (const int animID, float speed, float blend, int flags)
 EnumAnimStateFlags.
 
void Blend (const int animID, float speed, float blend, int flags, const int frame, const bool runActions=true, const bool noSoundActions=false)
 EnumAnimStateFlags. Blends the animation to the frame while optionally running all previous actions.
 
void Set (const int animID, float speed, int flags)
 EnumAnimStateFlags.
 
void Set (const int animID, float speed, int flags, const int frame, const bool runActions=true, const bool noSoundActions=false)
 EnumAnimStateFlags. Sets the animation to the frame while optionally running all previous actions.
 
const int CurrentFrame ()
 current frame playing for the current animation. Must have an animation action keyframe for this to work, otherwise use TrackFrame() instead. This should be named more like last frame an action was checked to execute.
 
const int NumFrames ()
 number of frames in this animation. Returns -1 if no animation set.
 
const int NumNodes ()
 number of nodes in this animation. Returns -1 if no animation set.
 
const float PlayTime ()
 increases by GAME_DELTA_TIME if not stopped or paused.
 
const float TrackTime ()
 time from 0(on first frame) to 1(on last frame).
 
bool IsPlaying (const int animID)
 Returns true if current animations ID is animID and the animation is not stopped.
 
bool CheckAnimID (const int animID)
 checks if animID exists
 
const int PlayingID () const
 the current animations ID
 
void Stop ()
 flags |= ANF_STOPPED; flags &= ~ANF_LOOP;
 
void Pause ()
 flags |= ANF_PAUSED;
 
void Resume ()
 flags &= ~ANF_PAUSED;
 
const bool Stopped () const
 (flags & ANF_STOPPED) != 0
 
const bool Blending () const
 (flags & ANF_BLEND) != 0
 
const bool Looping () const
 (flags & ANF_LOOP) != 0
 
const bool CycleCompleted () const
 (flags & ANF_CYCLECOMPLETED) != 0
 
void ChangeSpeed (const float speed)
 Scales speed of the current animation where 1.0 = 15fps and 4.0 = 60fps.
 
void SetLastFrame (const bool execActions=false)
 if execActions is true, runs all key frame actions in the animation except Footstep(55) and PlaySound(248). applies the stop flag (flags |= ANF_STOPPED).
 
void SetPlayTime (const float time)
 The total time in seconds this animation has been playing.
 
void SetTrackTime (const float time)
 0.0(first frame) to 1.0(last frame)
 
const int TrackFrame (void) const
 current frame playing for the current animation.
 
const int TrackNextFrame (void) const
 next frame to play for the current animation.
 
kQuat GetRotation (const int animID, int nodeNum, int frame)
 
kVec3 GetOrigin (const int animID, int nodeNum, int frame)
 
const int GetAnimNumFrames (const int animID)
 
const int LoopFrame ()
 The frame the animation loops back to when it reaches the last frame. Returns -1 if no animation set.
 

Public Attributes

int flags
 EnumAnimStateFlags.
 
float baseOffset
 is somewhat the Z position of the root node. It's calculated as follows whenever the root motion is updated (ANF_ROOTMOTION must be set).
 
kVec3 rootMotion
 the move direction of the root node from the prev frame to the current frame.
 

Detailed Description

Definition at line 1160 of file t1_scriptAPI.cpp.

Member Function Documentation

◆ Blend() [1/2]

void kAnimState::Blend ( const int animID,
float speed,
float blend,
int flags )

◆ Blend() [2/2]

void kAnimState::Blend ( const int animID,
float speed,
float blend,
int flags,
const int frame,
const bool runActions = true,
const bool noSoundActions = false )

EnumAnimStateFlags. Blends the animation to the frame while optionally running all previous actions.

◆ Blending()

const bool kAnimState::Blending ( ) const

(flags & ANF_BLEND) != 0

◆ ChangeSpeed()

void kAnimState::ChangeSpeed ( const float speed)

Scales speed of the current animation where 1.0 = 15fps and 4.0 = 60fps.

◆ CheckAnimID()

bool kAnimState::CheckAnimID ( const int animID)

checks if animID exists

◆ CurrentFrame()

const int kAnimState::CurrentFrame ( )

current frame playing for the current animation. Must have an animation action keyframe for this to work, otherwise use TrackFrame() instead. This should be named more like last frame an action was checked to execute.

◆ CycleCompleted()

const bool kAnimState::CycleCompleted ( ) const

(flags & ANF_CYCLECOMPLETED) != 0

◆ GetAnimNumFrames()

const int kAnimState::GetAnimNumFrames ( const int animID)

◆ GetOrigin()

kVec3 kAnimState::GetOrigin ( const int animID,
int nodeNum,
int frame )

◆ GetRotation()

kQuat kAnimState::GetRotation ( const int animID,
int nodeNum,
int frame )

◆ IsPlaying()

bool kAnimState::IsPlaying ( const int animID)

Returns true if current animations ID is animID and the animation is not stopped.

◆ LoopFrame()

const int kAnimState::LoopFrame ( )

The frame the animation loops back to when it reaches the last frame. Returns -1 if no animation set.

◆ Looping()

const bool kAnimState::Looping ( ) const

(flags & ANF_LOOP) != 0

◆ NumFrames()

const int kAnimState::NumFrames ( )

number of frames in this animation. Returns -1 if no animation set.

◆ NumNodes()

const int kAnimState::NumNodes ( )

number of nodes in this animation. Returns -1 if no animation set.

◆ Pause()

void kAnimState::Pause ( )

flags |= ANF_PAUSED;

◆ PlayingID()

const int kAnimState::PlayingID ( ) const

the current animations ID

◆ PlayTime()

const float kAnimState::PlayTime ( )

increases by GAME_DELTA_TIME if not stopped or paused.

◆ Resume()

void kAnimState::Resume ( )

flags &= ~ANF_PAUSED;

◆ Set() [1/2]

void kAnimState::Set ( const int animID,
float speed,
int flags )

◆ Set() [2/2]

void kAnimState::Set ( const int animID,
float speed,
int flags,
const int frame,
const bool runActions = true,
const bool noSoundActions = false )

EnumAnimStateFlags. Sets the animation to the frame while optionally running all previous actions.

◆ SetLastFrame()

void kAnimState::SetLastFrame ( const bool execActions = false)

if execActions is true, runs all key frame actions in the animation except Footstep(55) and PlaySound(248). applies the stop flag (flags |= ANF_STOPPED).

◆ SetPlayTime()

void kAnimState::SetPlayTime ( const float time)

The total time in seconds this animation has been playing.

◆ SetTrackTime()

void kAnimState::SetTrackTime ( const float time)

0.0(first frame) to 1.0(last frame)

◆ Stop()

void kAnimState::Stop ( )

flags |= ANF_STOPPED; flags &= ~ANF_LOOP;

◆ Stopped()

const bool kAnimState::Stopped ( ) const

(flags & ANF_STOPPED) != 0

◆ TrackFrame()

const int kAnimState::TrackFrame ( void ) const

current frame playing for the current animation.

◆ TrackNextFrame()

const int kAnimState::TrackNextFrame ( void ) const

next frame to play for the current animation.

◆ TrackTime()

const float kAnimState::TrackTime ( )

time from 0(on first frame) to 1(on last frame).

Member Data Documentation

◆ baseOffset

float kAnimState::baseOffset

is somewhat the Z position of the root node. It's calculated as follows whenever the root motion is updated (ANF_ROOTMOTION must be set).

// vBlendPos: is the blended position of the root node (node 0) from the prev frame to the current frame.
// m_pOwner->BaseHeight(): is the Height of the actor when it spawned (or when SetSpawnParams is called on non map actors).
baseOffset = vBlendPos.z * m_pOwner->Scale().z;
baseOffset -= m_pOwner->BaseHeight() * 0.6f;
if(baseOffset < 0) baseOffset = 0;
float baseOffset
is somewhat the Z position of the root node. It's calculated as follows whenever the root motion is u...

Definition at line 1205 of file t1_scriptAPI.cpp.

◆ flags

int kAnimState::flags

EnumAnimStateFlags.

Definition at line 1192 of file t1_scriptAPI.cpp.

◆ rootMotion

kVec3 kAnimState::rootMotion

the move direction of the root node from the prev frame to the current frame.

Definition at line 1206 of file t1_scriptAPI.cpp.