Drag[en]gine Game Engine
1.21
|
DVector value with smooth adjusting over time. More...
#include <decSmoothDVector.h>
Public Member Functions | |
Constructors and Destructors | |
decSmoothDVector () | |
Create a new smooth dvector. More... | |
decSmoothDVector (const decSmoothDVector ©) | |
Create copy of a smooth dvector. More... | |
~decSmoothDVector () | |
Clean up smooth dvector. More... | |
Management | |
const decDVector & | GetValue () const |
Current value. More... | |
void | SetValue (const decDVector &value) |
Set current value. More... | |
const decDVector & | GetGoal () const |
Goal value. More... | |
void | SetGoal (const decDVector &goal) |
Set goal value. More... | |
double | GetAdjustTime () const |
Adjustment time in seconds. More... | |
void | SetAdjustTime (double adjustTime) |
Adjustment time in seconds. Clamped to 0 or larger. More... | |
double | GetAdjustRange () const |
Adjustment range in units. More... | |
void | SetAdjustRange (double range) |
Set adjustment range in units. Clamped to 0 or larger. More... | |
double | GetChangeSpeed () const |
Change speed of the value in units per second. More... | |
void | SetChangeSpeed (double 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 (double elapsed) |
Update value with goal using current smoothing parameters. More... | |
Operators | |
bool | operator== (const decSmoothDVector &other) const |
Determine if another smooth dvector equals this smooth dvector. More... | |
bool | operator!= (const decSmoothDVector &other) const |
Determine if two smooth dvector are not equal. More... | |
decSmoothDVector & | operator= (const decSmoothDVector &other) |
Copy another smooth dvector to this smooth dvector. More... | |
DVector value with smooth adjusting over time.
Distance over time is used as change speed.
decSmoothDVector::decSmoothDVector | ( | ) |
Create a new smooth dvector.
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.
decSmoothDVector::decSmoothDVector | ( | const decSmoothDVector & | copy | ) |
Create copy of a smooth dvector.
decSmoothDVector::~decSmoothDVector | ( | ) |
Clean up smooth dvector.
|
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 decSmoothDVector::operator!= | ( | const decSmoothDVector & | other | ) | const |
Determine if two smooth dvector are not equal.
Two smooth dvectors are not equal if their value is not equal.
decSmoothDVector& decSmoothDVector::operator= | ( | const decSmoothDVector & | other | ) |
Copy another smooth dvector to this smooth dvector.
bool decSmoothDVector::operator== | ( | const decSmoothDVector & | other | ) | const |
Determine if another smooth dvector equals this smooth dvector.
Two smooth dvectors are equal if their value is equal.
void decSmoothDVector::Reset | ( | ) |
Reset value, goal and change speed to 0.
void decSmoothDVector::SetAdjustRange | ( | double | range | ) |
Set adjustment range in units. Clamped to 0 or larger.
void decSmoothDVector::SetAdjustTime | ( | double | adjustTime | ) |
Adjustment time in seconds. Clamped to 0 or larger.
void decSmoothDVector::SetChangeSpeed | ( | double | changeSpeed | ) |
Set change speed of the value in units per second.
void decSmoothDVector::SetGoal | ( | const decDVector & | goal | ) |
Set goal value.
void decSmoothDVector::SetValue | ( | const decDVector & | value | ) |
Set current value.
void decSmoothDVector::Update | ( | double | 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. |