UFO: Alien Invasion
Loading...
Searching...
No Matches
r_mesh_anim.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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 (float backlerp, int numframes, const mAliasTagOrientation_t *current, const mAliasTagOrientation_t *old, float *interpolated)
 Interpolate the transform for a model places on a tag of another model.

Function Documentation

◆ R_AnimAppend()

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]asThe animation state to append the new animation to
[in]modThe model to append the animation for
[in]nameThe animation name (from the *.anm file) to append

Definition at line 84 of file r_mesh_anim.cpp.

References model_t::alias, animState_t::backlerp, animState_t::change, Com_Printf(), animState_t::dt, animState_t::frame, mAliasAnim_t::from, animState_t::ladd, animState_t::lcur, model_t::name, name, mAliasModel_t::num_anims, animState_t::oldframe, R_AnimAdd(), R_AnimGet(), animState_t::time, mAliasAnim_t::time, and mAliasAnim_t::to.

Referenced by CL_ActorDie(), and CL_ActorDoShoot().

◆ R_AnimChange()

◆ R_AnimGetName()

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]asThe animation state to check
[in]modThe model to check
Returns
nullptr if no animation is set or running or the name of the current running animation otherwise.

Definition at line 242 of file r_mesh_anim.cpp.

References model_t::alias, animState_t::ladd, animState_t::lcur, MAX_ANIMLIST, mAliasAnim_t::name, mAliasModel_t::num_anims, and R_AnimGetAliasAnim.

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

◆ R_AnimRun()

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]asThe animation state to run
[in]modThe model to run the animation for
[in]msecThe milliseconds since this was called last

Definition at line 192 of file r_mesh_anim.cpp.

References model_t::alias, animState_t::backlerp, animState_t::change, animState_t::dt, animState_t::frame, mAliasAnim_t::from, animState_t::ladd, animState_t::lcur, LOOPNEXT, MAX_ANIMLIST, mAliasModel_t::num_anims, animState_t::oldframe, R_AnimGetAliasAnim, animState_t::time, mAliasAnim_t::time, and mAliasAnim_t::to.

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

◆ R_InterpolateTransform()

void R_InterpolateTransform ( float backLerp,
int numframes,
const mAliasTagOrientation_t * current,
const mAliasTagOrientation_t * old,
float * interpolated )

Interpolate the transform for a model places on a tag of another model.

Parameters
[out]interpolatedThis is an array of 16 floats
[in]currentThe current frame tag data
[in]oldThe old frame tag data
[in]backLerpthe linear interpolation value [0.0,1.0]
[in]numframesThe max frames of the tag data

Definition at line 212 of file r_mesh.cpp.

References mAliasTagOrientation_t::axis, i, mAliasTagOrientation_t::origin, R_ComputeGLMatrixFromTag(), and VectorNormalizeFast().

Referenced by R_CalcTransform(), and R_DrawModelDirect().