Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.SmoothVector2 Class Reference

Smooth 2-component vector value. More...

Inheritance diagram for Dragengine.Scenery.SmoothVector2:

Public Member Functions

Constructors
SmoothVector2 new ()
 Create smooth vector. More...
 
SmoothVector2 new (SmoothVector2 copy)
 Create copy of smooth vector. More...
 
Management
Vector2 getValue ()
 Current value. More...
 
void setValue (Vector2 value)
 Set current value. More...
 
Vector2 getGoal ()
 Goal value. More...
 
void setGoal (Vector2 goal)
 Set goal value. More...
 
float getAdjustTime ()
 Adjustment time in seconds. More...
 
void setAdjustTime (float adjustTime)
 Adjustment time in seconds clamped to 0 or larger. More...
 
float getAdjustRange ()
 Adjustment range in units. More...
 
void setAdjustRange (float limit)
 Set adjustment range in units clamped to 0 or larger. More...
 
float getChangeSpeed ()
 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...
 

File Handling

void writeToFile (FileWriter writer)
 Write to file writer. More...
 
static SmoothVector2 readFromFile (FileReader reader)
 Read from file reader. More...
 

Detailed Description

Smooth 2-component vector value.

Smooth dynamic changing vector value across time.

Member Function Documentation

◆ getAdjustRange()

float Dragengine.Scenery.SmoothVector2.getAdjustRange ( )

Adjustment range in units.

◆ getAdjustTime()

float Dragengine.Scenery.SmoothVector2.getAdjustTime ( )

Adjustment time in seconds.

◆ getChangeSpeed()

float Dragengine.Scenery.SmoothVector2.getChangeSpeed ( )

Change speed of the value in units per second.

◆ getGoal()

Vector2 Dragengine.Scenery.SmoothVector2.getGoal ( )

Goal value.

◆ getValue()

Vector2 Dragengine.Scenery.SmoothVector2.getValue ( )

Current value.

◆ new() [1/2]

SmoothVector2 Dragengine.Scenery.SmoothVector2.new ( )

Create 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.

◆ new() [2/2]

SmoothVector2 Dragengine.Scenery.SmoothVector2.new ( SmoothVector2  copy)

Create copy of smooth vector.

◆ readFromFile()

static SmoothVector2 Dragengine.Scenery.SmoothVector2.readFromFile ( FileReader  reader)
static

Read from file reader.

◆ reset()

void Dragengine.Scenery.SmoothVector2.reset ( )

Reset value, goal and change speed to 0.

◆ setAdjustRange()

void Dragengine.Scenery.SmoothVector2.setAdjustRange ( float  limit)

Set adjustment range in units clamped to 0 or larger.

◆ setAdjustTime()

void Dragengine.Scenery.SmoothVector2.setAdjustTime ( float  adjustTime)

Adjustment time in seconds clamped to 0 or larger.

◆ setChangeSpeed()

void Dragengine.Scenery.SmoothVector2.setChangeSpeed ( float  changeSpeed)

Set change speed of the value in units per second.

◆ setGoal()

void Dragengine.Scenery.SmoothVector2.setGoal ( Vector2  goal)

Set goal value.

◆ setValue()

void Dragengine.Scenery.SmoothVector2.setValue ( Vector2  value)

Set current value.

◆ update()

void Dragengine.Scenery.SmoothVector2.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.

◆ writeToFile()

void Dragengine.Scenery.SmoothVector2.writeToFile ( FileWriter  writer)

Write to file writer.


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