|
resonance 1.0.1
|
One run of an animation between two frames, played against a running time. More...
#include <animhelper.h>
Public Member Functions | |
| AnimHelper () | |
| Start idle with no animation. | |
| void | SetAnim (Rnd::Animatable *pAnim) |
| Attach the animation and rewind it to frame 0. | |
| void | Play (float flFrom, float flTo) |
| Arm a run between two frames. | |
| int | Update (float flTime) |
| Advance a run in progress. | |
One run of an animation between two frames, played against a running time.
The class is not polymorphic and emits no RTTI. Its name comes from the debugging symbols of the North American demo release. The demo's constructor and SetAnim() have the same instructions as this class's. HudPoints and several of the tunnel's components embed it by value.
Play() records the two frames in the animation's own numbering and arms the run. Each Update() then advances the animation one frame per unit of time from the first frame, and parks it on the last frame once the run passes it.
| AnimHelper::AnimHelper | ( | ) |
Start idle with no animation.
| void AnimHelper::SetAnim | ( | Rnd::Animatable * | pAnim | ) |
Attach the animation and rewind it to frame 0.
| pAnim | The animation to play. |
| void AnimHelper::Play | ( | float | flFrom, |
| float | flTo ) |
Arm a run between two frames.
Each frame is mapped back through the animation's filters first. The run starts at the next Update().
| flFrom | The first frame. |
| flTo | The last frame. |
| int AnimHelper::Update | ( | float | flTime | ) |
Advance a run in progress.
| flTime | The current time. The first call after Play() records it as the start. |