Drag[en]gine Script Module DragonScript
1.23
|
Mover support for elements. More...
Public Member Functions | |
void | attachRail (RailList rails) |
Find and attach rail and set collider to initial position. More... | |
float | getAcceleration () |
Acceleration time in m/s^2. More... | |
Collider | getCollider () |
Collider to update or null. More... | |
int | getCurrentCorner () |
Current corner index. More... | |
float | getCurrentVelocity () |
Current velocity. More... | |
Rail | getRail () |
Rail. More... | |
StringID | getRailID () |
Rail ID. More... | |
bool | getStartAtFirstCorner () |
Order of initial corner to place collider at. More... | |
int | getTargetCorner () |
Target corner index or -1. More... | |
float | getVelocity () |
Velocity in m/s. More... | |
bool | isMoving () |
Is moving. More... | |
Mover | new (Collider collider) |
Create mover. More... | |
void | readFromFile (PersistencyEnvironment env, FileReader reader) |
Read element from file. More... | |
void | setAcceleration (float acceleration) |
Set acceleration in m/s^2. More... | |
void | setDeceleration (float deceleration) |
Set deceleration in m/s^2. More... | |
void | setRail (Rail rail) |
Set rail. More... | |
void | setRailID (StringID id) |
Set rail ID. More... | |
void | setStartAtFirstCorner (bool startAtFirstCorner) |
Set order of initial corner to place collider at. More... | |
void | setVelocity (float velocity) |
Set velocity in m/s. More... | |
void | startMoving () |
Start moving. More... | |
void | update (float elapsed) |
Update element moving along rail. More... | |
void | writeToFile (PersistencyEnvironment env, FileWriter writer) |
Write element to file. More... | |
Protected Member Functions | |
void | setCurrentVelocity (float velocity) |
Set current velocity. More... | |
Mover support for elements.
void Dragengine.Scenery.ECComposeMoveOnRail.Mover.attachRail | ( | RailList | rails | ) |
Find and attach rail and set collider to initial position.
If rail can not be located or the rail has no corners an exception is thrown.
float Dragengine.Scenery.ECComposeMoveOnRail.Mover.getAcceleration | ( | ) |
Acceleration time in m/s^2.
int Dragengine.Scenery.ECComposeMoveOnRail.Mover.getCurrentCorner | ( | ) |
Current corner index.
float Dragengine.Scenery.ECComposeMoveOnRail.Mover.getCurrentVelocity | ( | ) |
Current velocity.
bool Dragengine.Scenery.ECComposeMoveOnRail.Mover.getStartAtFirstCorner | ( | ) |
Order of initial corner to place collider at.
int Dragengine.Scenery.ECComposeMoveOnRail.Mover.getTargetCorner | ( | ) |
Target corner index or -1.
float Dragengine.Scenery.ECComposeMoveOnRail.Mover.getVelocity | ( | ) |
Velocity in m/s.
bool Dragengine.Scenery.ECComposeMoveOnRail.Mover.isMoving | ( | ) |
Is moving.
void Dragengine.Scenery.ECComposeMoveOnRail.Mover.readFromFile | ( | PersistencyEnvironment | env, |
FileReader | reader | ||
) |
Read element from file.
Restores these values (for others owner is responsible):
void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setAcceleration | ( | float | acceleration | ) |
Set acceleration in m/s^2.
|
protected |
Set current velocity.
void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setDeceleration | ( | float | deceleration | ) |
Set deceleration in m/s^2.
void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setRail | ( | Rail | rail | ) |
Set rail.
Stops collider from moving.
void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setRailID | ( | StringID | id | ) |
Set rail ID.
void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setStartAtFirstCorner | ( | bool | startAtFirstCorner | ) |
Set order of initial corner to place collider at.
void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setVelocity | ( | float | velocity | ) |
Set velocity in m/s.
void Dragengine.Scenery.ECComposeMoveOnRail.Mover.startMoving | ( | ) |
Start moving.
If at first corner moves towards the last corner otherwise towards the first corner.
void Dragengine.Scenery.ECComposeMoveOnRail.Mover.update | ( | float | elapsed | ) |
Update element moving along rail.
void Dragengine.Scenery.ECComposeMoveOnRail.Mover.writeToFile | ( | PersistencyEnvironment | env, |
FileWriter | writer | ||
) |
Write element to file.
Persists these values (for others owner is responsible):