resonance 1.0.1
Loading...
Searching...
No Matches
linearanim.h
Go to the documentation of this file.
1#pragma once
2
13public:
21
34 void SetParams(float flFrom, float flTo, float flDuration);
35
43 void SetTarget(float flTarget);
44
55 void Jump(float flTarget);
56
64 float Val() const;
65
78 int Execute(float flTime);
79
80private:
81 // The time Execute() last ran at. 9999999 marks no time recorded.
82 float mLastTime; // +0x00
83 float mTarget; // +0x04
84 float mCurrent; // +0x08
85 // Raw units per unit of time.
86 float mRate; // +0x0c
87 float mScale; // +0x10
88 float mOffset; // +0x14
89};
int Execute(float flTime)
Move the raw value toward the target by the time elapsed since the last call.
void SetTarget(float flTarget)
Set the raw value to move toward.
LinearAnim()
Start at 0 with no time recorded, mapping 0 through 1 onto 0 through 100 over 240 units.
float Val() const
Report the mapped value.
void Jump(float flTarget)
Set the target and move the raw value almost onto it at once.
void SetParams(float flFrom, float flTo, float flDuration)
Set the mapping and the rate.