|
Drag[en]gine Script Module DragonScript 1.32.1
|
Smooth floating point value. More...
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. | |
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.