Drag[en]gine Game Engine
1.21
|
Vector value with smooth adjusting over time. More...
#include <decSmoothVector.h>
Public Member Functions | |
Constructors and Destructors | |
decSmoothVector () | |
Create a new smooth vector. More... | |
decSmoothVector (const decSmoothVector ©) | |
Create copy of a smooth vector. More... | |
~decSmoothVector () | |
Clean up smooth vector. More... | |
Management | |
const decVector & | GetValue () const |
Current value. More... | |
void | SetValue (const decVector &value) |
Set current value. More... | |
const decVector & | GetGoal () const |
Goal value. More... | |
void | SetGoal (const decVector &goal) |
Set goal value. More... | |
float | GetAdjustTime () const |
Adjustment time in seconds. More... | |
void | SetAdjustTime (float adjustTime) |
Adjustment time in seconds. Clamped to 0 or larger. More... | |
float | GetAdjustRange () const |
Adjustment range in units. More... | |
void | SetAdjustRange (float range) |
Set adjustment range in units. Clamped to 0 or larger. More... | |
float | GetChangeSpeed () const |
Change speed of the value in units per second. More... | |
void | SetChangeSpeed (float changeSpeed) |
Set change speed of the value in units per second. More... | |
void | Reset () |
Reset value, goal and change speed to 0. More... | |
void | Update (float elapsed) |
Update value with goal using current smoothing parameters. More... | |
Operators | |
bool | operator== (const decSmoothVector &other) const |
Determine if another smooth vector equals this smooth vector. More... | |
bool | operator!= (const decSmoothVector &other) const |
Determine if two smooth vector are not equal. More... | |
decSmoothVector & | operator= (const decSmoothVector &other) |
Copy another smooth vector to this smooth vector. More... | |
Vector value with smooth adjusting over time.
Distance over time is used as change speed.
decSmoothVector::decSmoothVector | ( | ) |
Create a new smooth vector.
Value, goal and change speed are set to 0. Adjust time is set to 1s. Change speed limit is set to 1 unit per second.
decSmoothVector::decSmoothVector | ( | const decSmoothVector & | copy | ) |
Create copy of a smooth vector.
decSmoothVector::~decSmoothVector | ( | ) |
Clean up smooth vector.
|
inline |
Adjustment range in units.
|
inline |
Adjustment time in seconds.
|
inline |
Change speed of the value in units per second.
|
inline |
Goal value.
|
inline |
Current value.
bool decSmoothVector::operator!= | ( | const decSmoothVector & | other | ) | const |
Determine if two smooth vector are not equal.
Two smooth vectors are not equal if their value is not equal.
decSmoothVector& decSmoothVector::operator= | ( | const decSmoothVector & | other | ) |
Copy another smooth vector to this smooth vector.
bool decSmoothVector::operator== | ( | const decSmoothVector & | other | ) | const |
Determine if another smooth vector equals this smooth vector.
Two smooth vectors are equal if their value is equal.
void decSmoothVector::Reset | ( | ) |
Reset value, goal and change speed to 0.
void decSmoothVector::SetAdjustRange | ( | float | range | ) |
Set adjustment range in units. Clamped to 0 or larger.
void decSmoothVector::SetAdjustTime | ( | float | adjustTime | ) |
Adjustment time in seconds. Clamped to 0 or larger.
void decSmoothVector::SetChangeSpeed | ( | float | changeSpeed | ) |
Set change speed of the value in units per second.
void decSmoothVector::SetGoal | ( | const decVector & | goal | ) |
Set goal value.
void decSmoothVector::SetValue | ( | const decVector & | value | ) |
Set current value.
void decSmoothVector::Update | ( | float | elapsed | ) |
Update value with goal using current smoothing parameters.
Goal is not modified.
[in] | elapsed | Elapsed time in seconds. If less than 0.001s update is skipped. |