Go to the source code of this file.
◆ anim_set()
- Parameters
-
anim | x = startframe, y = numframes, z = framerate |
Definition at line 6 of file anim.qc.
References BITXOR_ASSIGN, EF_RESTARTANIM_BIT, frametime, and time.
Referenced by viewmodel_draw(), and W_Model().
10 if (
anim.x == e.animstate_startframe)
12 if (
anim.y == e.animstate_numframes)
14 if (
anim.z == e.animstate_framerate)
22 e.animstate_startframe =
anim.x;
23 e.animstate_numframes =
anim.y;
24 e.animstate_framerate =
anim.z;
26 e.animstate_endtime = e.animstate_starttime + e.animstate_numframes / e.animstate_framerate;
27 e.animstate_looping = looping;
28 e.animstate_override =
override;
29 e.frame = e.animstate_startframe;
const int EF_RESTARTANIM_BIT
#define BITXOR_ASSIGN(a, b)
◆ anim_update()
Update e.frame based on its animstate relative to time.
Definition at line 36 of file anim.qc.
References bound(), and time.
Referenced by viewmodel_draw().
38 if (
time >= e.animstate_endtime)
40 if (e.animstate_looping)
42 e.animstate_starttime = e.animstate_endtime;
43 e.animstate_endtime = e.animstate_starttime + e.animstate_numframes / e.animstate_framerate;
45 e.animstate_override =
false;
47 float frameofs =
bound(0, (
time - e.animstate_starttime) * e.animstate_framerate, e.animstate_numframes - 1);
48 e.frame = e.animstate_startframe + frameofs;