|
Drag[en]gine Script Module DragonScript 1.35
|
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 | ( | ) |
| float Dragengine.Scenery.SmoothFloat.getAdjustTime | ( | ) |
Adjustment time in seconds.
Referenced by getAdjustRange().
| float Dragengine.Scenery.SmoothFloat.getChangeSpeed | ( | ) |
| float Dragengine.Scenery.SmoothFloat.getGoal | ( | ) |
| float Dragengine.Scenery.SmoothFloat.getValue | ( | ) |
| SmoothFloat Dragengine.Scenery.SmoothFloat.new | ( | ) |
| SmoothFloat Dragengine.Scenery.SmoothFloat.new | ( | SmoothFloat | copy | ) |
Create copy of smooth float.
References new().
|
static |
| void Dragengine.Scenery.SmoothFloat.reset | ( | ) |
Reset value, goal and change speed to 0.
References getChangeSpeed(), and setAdjustRange().
Referenced by readFromFile().
| void Dragengine.Scenery.SmoothFloat.setAdjustRange | ( | float | limit | ) |
Set adjustment range in units clamped to 0 or larger.
Referenced by reset().
| void Dragengine.Scenery.SmoothFloat.setAdjustTime | ( | float | adjustTime | ) |
Adjustment time in seconds clamped to 0 or larger.
References setGoal().
Referenced by getChangeSpeed().
| void Dragengine.Scenery.SmoothFloat.setChangeSpeed | ( | float | changeSpeed | ) |
Set change speed of the value in units per second.
References getAdjustRange().
Referenced by update().
| void Dragengine.Scenery.SmoothFloat.setGoal | ( | float | goal | ) |
| void Dragengine.Scenery.SmoothFloat.setValue | ( | float | value | ) |
Set current value.
Referenced by getGoal().
| 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. |
References setChangeSpeed().
Referenced by writeToFile().
| void Dragengine.Scenery.SmoothFloat.writeToFile | ( | FileWriter | writer | ) |
Write to file writer.
References readFromFile(), update(), and writeToFile().
Referenced by writeToFile().