This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

BodyRail Class

This class represents a spline along which an arbitrary rigid body can be moved. For example, it allows to create a physically simulated train moving along the railtrack. BodyRigid and BodyRail should be connected together with JointRail.

BodyRail Class

This class inherits from Body

Members


BodyRail ()

Constructor. Creates a rail body with default properties.

BodyRail (Object object)

Constructor. Creates a rail body with default properties for a given object.

Arguments

  • Object object - Object represented with the new rail body.

quat getClosestOrientation (vec3 position)

Finds the point on the spline which is the closest to the given reference point and returns orientation set by the spline in it.

Arguments

  • vec3 position - Coordinates of the reference point.

Return value

Orientation set by the spline in the found point.

vec3 getClosestPosition (vec3 position)

Finds the point on the spline which is the closest to the given reference point.

Arguments

  • vec3 position - Coordinates of the reference point.

Return value

World coordinates of the found point on the spline.

string getSplineName ()

Returns a name of the spline along which physical objects are moving.

Return value

Path to the spline file.

void setSplineName (string name)

Sets a spline along which physical objects will be moving.

Arguments

  • string name - Path to the spline file.
Last update: 2017-07-03
Build: ()