Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ECComposeMoveOnRail.Mover Class Reference

Mover support for elements. More...

Inheritance diagram for Dragengine.Scenery.ECComposeMoveOnRail.Mover:

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...
 

Detailed Description

Mover support for elements.

Member Function Documentation

◆ attachRail()

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.

◆ getAcceleration()

float Dragengine.Scenery.ECComposeMoveOnRail.Mover.getAcceleration ( )

Acceleration time in m/s^2.

◆ getCollider()

Collider Dragengine.Scenery.ECComposeMoveOnRail.Mover.getCollider ( )

Collider to update or null.

◆ getCurrentCorner()

int Dragengine.Scenery.ECComposeMoveOnRail.Mover.getCurrentCorner ( )

Current corner index.

◆ getCurrentVelocity()

float Dragengine.Scenery.ECComposeMoveOnRail.Mover.getCurrentVelocity ( )

Current velocity.

◆ getRail()

Rail Dragengine.Scenery.ECComposeMoveOnRail.Mover.getRail ( )

Rail.

◆ getRailID()

StringID Dragengine.Scenery.ECComposeMoveOnRail.Mover.getRailID ( )

Rail ID.

◆ getStartAtFirstCorner()

bool Dragengine.Scenery.ECComposeMoveOnRail.Mover.getStartAtFirstCorner ( )

Order of initial corner to place collider at.

◆ getTargetCorner()

int Dragengine.Scenery.ECComposeMoveOnRail.Mover.getTargetCorner ( )

Target corner index or -1.

◆ getVelocity()

float Dragengine.Scenery.ECComposeMoveOnRail.Mover.getVelocity ( )

Velocity in m/s.

◆ isMoving()

bool Dragengine.Scenery.ECComposeMoveOnRail.Mover.isMoving ( )

Is moving.

◆ new()

Mover Dragengine.Scenery.ECComposeMoveOnRail.Mover.new ( Collider  collider)

Create mover.

◆ readFromFile()

void Dragengine.Scenery.ECComposeMoveOnRail.Mover.readFromFile ( PersistencyEnvironment  env,
FileReader  reader 
)

Read element from file.

Restores these values (for others owner is responsible):

  • current velocity
  • current corner
  • target corner
  • remaining distance

◆ setAcceleration()

void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setAcceleration ( float  acceleration)

Set acceleration in m/s^2.

◆ setCurrentVelocity()

void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setCurrentVelocity ( float  velocity)
protected

Set current velocity.

◆ setDeceleration()

void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setDeceleration ( float  deceleration)

Set deceleration in m/s^2.

◆ setRail()

void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setRail ( Rail  rail)

Set rail.

Stops collider from moving.

◆ setRailID()

void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setRailID ( StringID  id)

Set rail ID.

◆ setStartAtFirstCorner()

void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setStartAtFirstCorner ( bool  startAtFirstCorner)

Set order of initial corner to place collider at.

◆ setVelocity()

void Dragengine.Scenery.ECComposeMoveOnRail.Mover.setVelocity ( float  velocity)

Set velocity in m/s.

◆ startMoving()

void Dragengine.Scenery.ECComposeMoveOnRail.Mover.startMoving ( )

Start moving.

If at first corner moves towards the last corner otherwise towards the first corner.

◆ update()

void Dragengine.Scenery.ECComposeMoveOnRail.Mover.update ( float  elapsed)

Update element moving along rail.

◆ writeToFile()

void Dragengine.Scenery.ECComposeMoveOnRail.Mover.writeToFile ( PersistencyEnvironment  env,
FileWriter  writer 
)

Write element to file.

Persists these values (for others owner is responsible):

  • current velocity
  • current corner
  • target corner
  • remaining distance

The documentation for this class was generated from the following file: