Drag[en]gine Game Engine  1.21
decSmoothVector Class Reference

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 &copy)
 Create copy of a smooth vector. More...
 
 ~decSmoothVector ()
 Clean up smooth vector. More...
 
Management
const decVectorGetValue () const
 Current value. More...
 
void SetValue (const decVector &value)
 Set current value. More...
 
const decVectorGetGoal () 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...
 
decSmoothVectoroperator= (const decSmoothVector &other)
 Copy another smooth vector to this smooth vector. More...
 

Detailed Description

Vector value with smooth adjusting over time.

Distance over time is used as change speed.

Constructor & Destructor Documentation

◆ decSmoothVector() [1/2]

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

decSmoothVector::decSmoothVector ( const decSmoothVector copy)

Create copy of a smooth vector.

◆ ~decSmoothVector()

decSmoothVector::~decSmoothVector ( )

Clean up smooth vector.

Member Function Documentation

◆ GetAdjustRange()

float decSmoothVector::GetAdjustRange ( ) const
inline

Adjustment range in units.

◆ GetAdjustTime()

float decSmoothVector::GetAdjustTime ( ) const
inline

Adjustment time in seconds.

◆ GetChangeSpeed()

float decSmoothVector::GetChangeSpeed ( ) const
inline

Change speed of the value in units per second.

◆ GetGoal()

const decVector& decSmoothVector::GetGoal ( ) const
inline

Goal value.

◆ GetValue()

const decVector& decSmoothVector::GetValue ( ) const
inline

Current value.

◆ operator!=()

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.

◆ operator=()

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

Copy another smooth vector to this smooth vector.

◆ operator==()

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.

◆ Reset()

void decSmoothVector::Reset ( )

Reset value, goal and change speed to 0.

◆ SetAdjustRange()

void decSmoothVector::SetAdjustRange ( float  range)

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

◆ SetAdjustTime()

void decSmoothVector::SetAdjustTime ( float  adjustTime)

Adjustment time in seconds. Clamped to 0 or larger.

◆ SetChangeSpeed()

void decSmoothVector::SetChangeSpeed ( float  changeSpeed)

Set change speed of the value in units per second.

◆ SetGoal()

void decSmoothVector::SetGoal ( const decVector goal)

Set goal value.

◆ SetValue()

void decSmoothVector::SetValue ( const decVector value)

Set current value.

◆ Update()

void decSmoothVector::Update ( float  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: