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