r_mesh_anim.c File Reference

animation parsing and playing More...

#include "r_local.h"
#include "r_mesh_anim.h"
Include dependency graph for r_mesh_anim.c:

Go to the source code of this file.

Defines

#define LNEXT(x)   ((x + 1 < MAX_ANIMLIST) ? x + 1 : 0)

Functions

static const mAliasAnim_tR_AnimGet (const model_t *mod, const char *name)
 Searches a given animation id in the given model data.
void R_AnimAppend (animState_t *as, const model_t *mod, const char *name)
 Appends a new animation to the current running one.
void R_AnimChange (animState_t *as, const model_t *mod, const char *name)
 Changes the animation for md2 models.
void R_AnimRun (animState_t *as, const model_t *mod, int msec)
 Run the animation of the given model.
const char * R_AnimGetName (const animState_t *as, const model_t *mod)
 Get the current running animation for a model.
void R_InterpolateTransform (animState_t *as, int numframes, const float *tag, float *interpolated)

Detailed Description

animation parsing and playing

Definition in file r_mesh_anim.c.


Define Documentation

#define LNEXT (  )     ((x + 1 < MAX_ANIMLIST) ? x + 1 : 0)

Definition at line 29 of file r_mesh_anim.c.

Referenced by R_AnimAppend(), R_AnimChange(), and R_AnimRun().


Function Documentation

void R_AnimAppend ( animState_t as,
const model_t mod,
const char *  name 
)

Appends a new animation to the current running one.

See also:
R_AnimGet
R_AnimChange
R_AnimRun
R_AnimGetName
Parameters:
[in,out] as The animation state to append the new animation to
[in] mod The model to append the animation for
[in] name The animation name (from the *.anm file) to append

Definition at line 68 of file r_mesh_anim.c.

References model_s::alias, mAliasModel_s::animdata, animState_s::backlerp, animState_s::dt, animState_s::frame, mAliasAnim_s::from, animState_s::ladd, animState_s::lcur, animState_s::list, LNEXT, MAX_ANIMLIST, mAliasModel_s::num_anims, animState_s::oldframe, R_AnimGet(), mAliasAnim_s::time, animState_s::time, and mAliasAnim_s::to.

Referenced by CL_ActorDie(), and CL_ActorDoShoot().

void R_AnimChange ( animState_t as,
const model_t mod,
const char *  name 
)
static const mAliasAnim_t* R_AnimGet ( const model_t mod,
const char *  name 
) [static]

Searches a given animation id in the given model data.

See also:
R_AnimChange
R_AnimAppend
R_AnimRun
R_AnimGetName
Parameters:
[in] mod The model to search the given animation id in
[in] name The animation name (from the *.anm file) to search
Returns:
NULL if not found, otherwise the animation data

Definition at line 41 of file r_mesh_anim.c.

References model_s::alias, mAliasModel_s::animdata, Com_Printf(), i, model_s::name, mAliasAnim_s::name, and mAliasModel_s::num_anims.

Referenced by R_AnimAppend(), and R_AnimChange().

const char* R_AnimGetName ( const animState_t as,
const model_t mod 
)

Get the current running animation for a model.

See also:
R_AnimGet
R_AnimAppend
R_AnimRun
R_AnimChange
Parameters:
[in] as The animation state to check
[in] mod The model to check
Returns:
NULL if no animation is set or running or the name of the current running animation otherwise.

Definition at line 223 of file r_mesh_anim.c.

References model_s::alias, mAliasModel_s::animdata, animState_s::ladd, animState_s::lcur, animState_s::list, MAX_ANIMLIST, mAliasAnim_s::name, and mAliasModel_s::num_anims.

Referenced by HUD_UpdateActorCvar(), UI_DrawModelNode(), and UI_DrawModelNodeWithUIModel().

void R_AnimRun ( animState_t as,
const model_t mod,
int  msec 
)

Run the animation of the given model.

See also:
R_AnimGet
R_AnimAppend
R_AnimChange
R_AnimGetName
Parameters:
[in,out] as The animation state to run
[in] mod The model to run the animation for
[in] msec The milliseconds since this was called last

Definition at line 172 of file r_mesh_anim.c.

References model_s::alias, mAliasModel_s::animdata, animState_s::backlerp, animState_s::change, animState_s::dt, animState_s::frame, mAliasAnim_s::from, animState_s::ladd, animState_s::lcur, animState_s::list, LNEXT, MAX_ANIMLIST, mAliasModel_s::num_anims, animState_s::oldframe, qfalse, mAliasAnim_s::time, animState_s::time, and mAliasAnim_s::to.

Referenced by LE_Think(), LM_AddToSceneOrder(), SEQ_Render3D(), UI_DrawModelNode(), and UI_DrawModelNodeWithUIModel().

void R_InterpolateTransform ( animState_t as,
int  numframes,
const float *  tag,
float *  interpolated 
)
Parameters:
[out] interpolated This is an array of 16 floats

Definition at line 243 of file r_mesh_anim.c.

References animState_s::backlerp, animState_s::frame, i, animState_s::oldframe, and VectorNormalize().

Referenced by R_CalcTransform(), and R_DrawModelDirect().


Generated by  doxygen 1.6.2