Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.SmoothFloat Class Reference

Smooth floating point value. More...

Inheritance diagram for Dragengine.Scenery.SmoothFloat:

Public Member Functions

Constructors
SmoothFloat new ()
 Create smooth float.
SmoothFloat new (SmoothFloat copy)
 Create copy of smooth float.
Management
float getValue ()
 Current value.
void setValue (float value)
 Set current value.
float getGoal ()
 Goal value.
void setGoal (float goal)
 Set goal value.
float getAdjustTime ()
 Adjustment time in seconds.
void setAdjustTime (float adjustTime)
 Adjustment time in seconds clamped to 0 or larger.
float getAdjustRange ()
 Adjustment range in units.
void setAdjustRange (float limit)
 Set adjustment range in units clamped to 0 or larger.
float getChangeSpeed ()
 Change speed of the value in units per second.
void setChangeSpeed (float changeSpeed)
 Set change speed of the value in units per second.
void reset ()
 Reset value, goal and change speed to 0.
void update (float elapsed)
 Update value with goal using current smoothing parameters.

File Handling

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

Detailed Description

Smooth floating point value.

Smooth dynamic changing floating point value across time.

Member Function Documentation

◆ getAdjustRange()

float Dragengine.Scenery.SmoothFloat.getAdjustRange ( )

Adjustment range in units.

References getAdjustTime().

Referenced by setChangeSpeed().

◆ getAdjustTime()

float Dragengine.Scenery.SmoothFloat.getAdjustTime ( )

Adjustment time in seconds.

Referenced by getAdjustRange().

◆ getChangeSpeed()

float Dragengine.Scenery.SmoothFloat.getChangeSpeed ( )

Change speed of the value in units per second.

References setAdjustTime().

Referenced by reset().

◆ getGoal()

float Dragengine.Scenery.SmoothFloat.getGoal ( )

Goal value.

References setValue().

Referenced by setGoal().

◆ getValue()

float Dragengine.Scenery.SmoothFloat.getValue ( )

Current value.

References getValue().

Referenced by getValue().

◆ new() [1/2]

SmoothFloat Dragengine.Scenery.SmoothFloat.new ( )

Create smooth float.

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.

References new().

Referenced by new(), and new().

◆ new() [2/2]

SmoothFloat Dragengine.Scenery.SmoothFloat.new ( SmoothFloat copy)

Create copy of smooth float.

References new().

◆ readFromFile()

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

Read from file reader.

References reset().

Referenced by writeToFile().

◆ reset()

void Dragengine.Scenery.SmoothFloat.reset ( )

Reset value, goal and change speed to 0.

References getChangeSpeed(), and setAdjustRange().

Referenced by readFromFile().

◆ setAdjustRange()

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

Set adjustment range in units clamped to 0 or larger.

Referenced by reset().

◆ setAdjustTime()

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

Adjustment time in seconds clamped to 0 or larger.

References setGoal().

Referenced by getChangeSpeed().

◆ setChangeSpeed()

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

Set change speed of the value in units per second.

References getAdjustRange().

Referenced by update().

◆ setGoal()

void Dragengine.Scenery.SmoothFloat.setGoal ( float goal)

Set goal value.

References getGoal().

Referenced by setAdjustTime().

◆ setValue()

void Dragengine.Scenery.SmoothFloat.setValue ( float value)

Set current value.

Referenced by getGoal().

◆ update()

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

References setChangeSpeed().

Referenced by writeToFile().

◆ writeToFile()

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

Write to file writer.

References readFromFile(), update(), and writeToFile().

Referenced by writeToFile().


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