Drag[en]gine Game Engine  1.21
decSmoothDVector Class Reference

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 &copy)
 Create copy of a smooth dvector. More...
 
 ~decSmoothDVector ()
 Clean up smooth dvector. More...
 
Management
const decDVectorGetValue () const
 Current value. More...
 
void SetValue (const decDVector &value)
 Set current value. More...
 
const decDVectorGetGoal () 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...
 
decSmoothDVectoroperator= (const decSmoothDVector &other)
 Copy another smooth dvector to this smooth dvector. More...
 

Detailed Description

DVector value with smooth adjusting over time.

Distance over time is used as change speed.

Constructor & Destructor Documentation

◆ decSmoothDVector() [1/2]

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() [2/2]

decSmoothDVector::decSmoothDVector ( const decSmoothDVector copy)

Create copy of a smooth dvector.

◆ ~decSmoothDVector()

decSmoothDVector::~decSmoothDVector ( )

Clean up smooth dvector.

Member Function Documentation

◆ GetAdjustRange()

double decSmoothDVector::GetAdjustRange ( ) const
inline

Adjustment range in units.

◆ GetAdjustTime()

double decSmoothDVector::GetAdjustTime ( ) const
inline

Adjustment time in seconds.

◆ GetChangeSpeed()

double decSmoothDVector::GetChangeSpeed ( ) const
inline

Change speed of the value in units per second.

◆ GetGoal()

const decDVector& decSmoothDVector::GetGoal ( ) const
inline

Goal value.

◆ GetValue()

const decDVector& decSmoothDVector::GetValue ( ) const
inline

Current value.

◆ operator!=()

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.

◆ operator=()

decSmoothDVector& decSmoothDVector::operator= ( const decSmoothDVector other)

Copy another smooth dvector to this smooth dvector.

◆ operator==()

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.

◆ Reset()

void decSmoothDVector::Reset ( )

Reset value, goal and change speed to 0.

◆ SetAdjustRange()

void decSmoothDVector::SetAdjustRange ( double  range)

Set adjustment range in units. Clamped to 0 or larger.

◆ SetAdjustTime()

void decSmoothDVector::SetAdjustTime ( double  adjustTime)

Adjustment time in seconds. Clamped to 0 or larger.

◆ SetChangeSpeed()

void decSmoothDVector::SetChangeSpeed ( double  changeSpeed)

Set change speed of the value in units per second.

◆ SetGoal()

void decSmoothDVector::SetGoal ( const decDVector goal)

Set goal value.

◆ SetValue()

void decSmoothDVector::SetValue ( const decDVector value)

Set current value.

◆ Update()

void decSmoothDVector::Update ( double  elapsed)

Update value with goal using current smoothing parameters.

Goal is not modified.

Parameters
[in]elapsedElapsed time in seconds. If less than 0.001s update is skipped.

The documentation for this class was generated from the following file: