Scripting API

Home Scripting API Index Class Overview

com.nolimitscoaster

Class Train


public class Train
extends Object

Represents a train

Method Summary

int getBogieCount()
  Gets the number of bogies this train has
void getBogieMatrix(int index, nlvm.math3d.Matrix4x4f m)
  Gets the bogie's orientation and position as a transformation matrix.
void getBogieOrientationAndPosition(int index, nlvm.math3d.Vector3f frontOut, nlvm.math3d.Vector3f topOut, nlvm.math3d.Vector3f rightOut, nlvm.math3d.Vector3f posOut)
  Gets the bogie's orientation unit vectors and position vector.
int getCarCount()
  Gets the number of cars this train has
void getCarMatrix(int index, nlvm.math3d.Matrix4x4f m)
  Gets the car's orientation and position as a transformation matrix.
void getCarOrientationAndPosition(int index, nlvm.math3d.Vector3f frontOut, nlvm.math3d.Vector3f topOut, nlvm.math3d.Vector3f rightOut, nlvm.math3d.Vector3f posOut)
  Gets the car's orientation unit vectors and position vector.
Coaster getCoaster()
  Returns the coaster this block belongs to
float getHarnessState()
  Returns the state of the harnesses (0...1), where 0 means fully closed and 1 means fully opened
StreamedSound getOnboardStreamedSound()
  Returns the currently onboard streamed sound
double getSpeed()
  Returns the current speed of the train in meters per second
bool isLashedToTrack()
  Returns the lashed to track state
void setLashedToTrack(bool lashed)
  Enabled or disabled the lashed to track state
void setOnboardStreamedSound(StreamedSound sound)
  Set the onboard streamed sound


Method Detail


getBogieCount

public final int getBogieCount()

Gets the number of bogies this train has

Returns:
    number of bogies


getBogieMatrix

public final void getBogieMatrix(int index, nlvm.math3d.Matrix4x4f m)

Gets the bogie's orientation and position as a transformation matrix.

The index goes from front of the train to the back. 0 <= index < getBogieCount(). Works similar to getBogieOrientationAndPosition, the result is stored in a transformation matrix instead.


getBogieOrientationAndPosition

public final void getBogieOrientationAndPosition(int index, nlvm.math3d.Vector3f frontOut, nlvm.math3d.Vector3f topOut, nlvm.math3d.Vector3f rightOut, nlvm.math3d.Vector3f posOut)

Gets the bogie's orientation unit vectors and position vector.

The index goes from front of the train to the back. 0 <= index < getBogieCount(). frontOut can be null if no front vector is requested. topOut can be null if no top vector is requested. rightOut can be null if no right-unit vector is requested. posOut can be null if no position vector is requested.


getCarCount

public final int getCarCount()

Gets the number of cars this train has

Returns:
    number of cars


getCarMatrix

public final void getCarMatrix(int index, nlvm.math3d.Matrix4x4f m)

Gets the car's orientation and position as a transformation matrix.

The index goes from front of the train to the back. 0 <= index < getCarCount(). Works similar to getCarOrientationAndPosition, the result is stored in a transformation matrix instead.


getCarOrientationAndPosition

public final void getCarOrientationAndPosition(int index, nlvm.math3d.Vector3f frontOut, nlvm.math3d.Vector3f topOut, nlvm.math3d.Vector3f rightOut, nlvm.math3d.Vector3f posOut)

Gets the car's orientation unit vectors and position vector.

The index goes from front of the train to the back. 0 <= index < getCarCount(). frontOut can be null if no front vector is requested. topOut can be null if no top vector is requested. rightOut can be null if no right-unit vector is requested. posOut can be null if no position vector is requested.


getCoaster

public final Coaster getCoaster()

Returns the coaster this block belongs to

Returns:
    coaster this block belongs to

Since:
    2.5.7.0


getHarnessState

public final float getHarnessState()

Returns the state of the harnesses (0...1), where 0 means fully closed and 1 means fully opened

Returns:
    harness state

Since:
    2.5.1.0


getOnboardStreamedSound

public final StreamedSound getOnboardStreamedSound()

Returns the currently onboard streamed sound


getSpeed

public final double getSpeed()

Returns the current speed of the train in meters per second

Returns:
    speed in meters per second (might be negative when running backwards)


isLashedToTrack

public final bool isLashedToTrack()

Returns the lashed to track state

Returns:
    true when lashed to track flag is set


setLashedToTrack

public final void setLashedToTrack(bool lashed)

Enabled or disabled the lashed to track state


setOnboardStreamedSound

public final void setOnboardStreamedSound(StreamedSound sound)

Set the onboard streamed sound