Drag[en]gine Script Module DragonScript
1.23
|
Smooth floating point value. More...
Public Member Functions | |
Constructors | |
SmoothFloat | new () |
Create smooth float. More... | |
SmoothFloat | new (SmoothFloat copy) |
Create copy of smooth float. More... | |
Management | |
float | getValue () |
Current value. More... | |
void | setValue (float value) |
Set current value. More... | |
float | getGoal () |
Goal value. More... | |
void | setGoal (float 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 SmoothFloat | readFromFile (FileReader reader) |
Read from file reader. More... | |
Smooth floating point value.
Smooth dynamic changing floating point value across time.
float Dragengine.Scenery.SmoothFloat.getAdjustRange | ( | ) |
Adjustment range in units.
float Dragengine.Scenery.SmoothFloat.getAdjustTime | ( | ) |
Adjustment time in seconds.
float Dragengine.Scenery.SmoothFloat.getChangeSpeed | ( | ) |
Change speed of the value in units per second.
float Dragengine.Scenery.SmoothFloat.getGoal | ( | ) |
Goal value.
float Dragengine.Scenery.SmoothFloat.getValue | ( | ) |
Current value.
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.
SmoothFloat Dragengine.Scenery.SmoothFloat.new | ( | SmoothFloat | copy | ) |
Create copy of smooth float.
|
static |
Read from file reader.
void Dragengine.Scenery.SmoothFloat.reset | ( | ) |
Reset value, goal and change speed to 0.
void Dragengine.Scenery.SmoothFloat.setAdjustRange | ( | float | limit | ) |
Set adjustment range in units clamped to 0 or larger.
void Dragengine.Scenery.SmoothFloat.setAdjustTime | ( | float | adjustTime | ) |
Adjustment time in seconds clamped to 0 or larger.
void Dragengine.Scenery.SmoothFloat.setChangeSpeed | ( | float | changeSpeed | ) |
Set change speed of the value in units per second.
void Dragengine.Scenery.SmoothFloat.setGoal | ( | float | goal | ) |
Set goal value.
void Dragengine.Scenery.SmoothFloat.setValue | ( | float | value | ) |
Set current value.
void Dragengine.Scenery.SmoothFloat.update | ( | float | 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. |
void Dragengine.Scenery.SmoothFloat.writeToFile | ( | FileWriter | writer | ) |
Write to file writer.