RigsofRods
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Script2Game::BeamClass Class Reference

Binding of RoR::Actor; a softbody-physics gameplay object, can be anything from soda can to space shuttle. More...

#include <BeamClass.h>

Public Member Functions

Physics state
TruckState getTruckState ()
 
vector3 getPosition ()
 Get vehicle absolute position. More...
 
vector3 getVehiclePosition ()
 
float getRotation ()
 Returns the angle in which the truck is heading. More...
 
float getHeadingDirectionAngle ()
 Returns the angle in which the truck is heading. More...
 
quaternion getOrientation () float getSpeed()
 Orientation on all axes packed to single quaternion. More...
 
vector3 getGForces ()
 Gets the G-forces that this truck is currently experiencing. More...
 
float getTotalMass (bool withLocked)
 Gets the total mass of the truck. More...
 
int getNodeCount ()
 Gets the total amount of nodes of the truck. More...
 
vector3 getNodePosition (int nodeNumber)
 Returns the position of the node. More...
 
vector3 isNodeWheelRim (int nodeNumber)
 Is node marked as wheel rim? Note some wheel models use only tire nodes. More...
 
vector3 isNodeWheelTire (int nodeNumber)
 Is node marked as wheel tire? Note some wheel models use only tire nodes. More...
 
int getWheelNodeCount ()
 Gets the total amount of nodes of the wheels of the truck. More...
 
float getWheelSpeed ()
 Gets the current wheel speed of the vehicle. More...
 
void reset (bool keep_position)
 Resets the truck. More...
 
TruckState getTruckState ()
 
vector3 getPosition ()
 Get vehicle absolute position. More...
 
vector3 getVehiclePosition ()
 
float getRotation ()
 Returns the angle in which the truck is heading. More...
 
float getHeadingDirectionAngle ()
 Returns the angle in which the truck is heading. More...
 
quaternion getOrientation () float getSpeed()
 Orientation on all axes packed to single quaternion. More...
 
vector3 getGForces ()
 Gets the G-forces that this truck is currently experiencing. More...
 
float getTotalMass (bool withLocked)
 Gets the total mass of the truck. More...
 
int getNodeCount ()
 Gets the total amount of nodes of the truck. More...
 
vector3 getNodePosition (int nodeNumber)
 Returns the position of the node. More...
 
vector3 isNodeWheelRim (int nodeNumber)
 Is node marked as wheel rim? Note some wheel models use only tire nodes. More...
 
vector3 isNodeWheelTire (int nodeNumber)
 Is node marked as wheel tire? Note some wheel models use only tire nodes. More...
 
int getWheelNodeCount ()
 Gets the total amount of nodes of the wheels of the truck. More...
 
float getWheelSpeed ()
 Gets the current wheel speed of the vehicle. More...
 
void reset (bool keep_position)
 Resets the truck. More...
 
Physics editing
void scaleTruck (float ratio)
 Scales the truck. More...
 
void setMass (float m)
 Sets the mass of the truck. More...
 
void setSimAttribute (ActorSimAttr attr, float val)
 Allows advanced users to set physics settings directly, including some not accessible from rig-def file format. More...
 
float getSimAttribute (ActorSimAttr attr)
 
void scaleTruck (float ratio)
 Scales the truck. More...
 
void setMass (float m)
 Sets the mass of the truck. More...
 
void setSimAttribute (ActorSimAttr attr, float val)
 Allows advanced users to set physics settings directly, including some not accessible from rig-def file format. More...
 
float getSimAttribute (ActorSimAttr attr)
 
User interaction
void parkingbrakeToggle ()
 Toggles the parking brake. More...
 
void tractioncontrolToggle ()
 Toggles the tracktion control. More...
 
void antilockbrakeToggle ()
 Toggles the anti-lock brakes. More...
 
void toggleCustomParticles ()
 Toggles the custom particles. More...
 
bool getCustomParticleMode ()
 Gets the custom particles mode. More...
 
bool isLocked ()
 Returns true if a hook of this truck is locked. More...
 
void setForcedCinecam (int cinecamId, int flags)
 Sets a forced cinecam for this actor; This disables camera hotkeys. More...
 
void clearForcedCinecam ()
 Resets the effect of setForcedCinecam();. More...
 
bool getForcedCinecam (int &inout, int &inout)
 Reports the values submitted by setForcedCinecam();. More...
 
int getNumCinecams () const
 Reports number of installed cinecams. More...
 
void parkingbrakeToggle ()
 Toggles the parking brake. More...
 
void tractioncontrolToggle ()
 Toggles the tracktion control. More...
 
void antilockbrakeToggle ()
 Toggles the anti-lock brakes. More...
 
void toggleCustomParticles ()
 Toggles the custom particles. More...
 
bool getCustomParticleMode ()
 Gets the custom particles mode. More...
 
bool isLocked ()
 Returns true if a hook of this truck is locked. More...
 
void setForcedCinecam (int cinecamId, int flags)
 Sets a forced cinecam for this actor; This disables camera hotkeys. More...
 
void clearForcedCinecam ()
 Resets the effect of setForcedCinecam();. More...
 
bool getForcedCinecam (int &inout, int &inout)
 Reports the values submitted by setForcedCinecam();. More...
 
int getNumCinecams () const
 Reports number of installed cinecams. More...
 
Subsystems
VehicleAiClass getVehicleAI ()
 Retrieve the waypoint AI object. More...
 
EngineClassPtr getEngine ()
 Retrieve engine/transmission simulator. More...
 
VehicleAiClass getVehicleAI ()
 Retrieve the waypoint AI object. More...
 
EngineClassPtr getEngine ()
 Retrieve engine/transmission simulator. More...
 
Vehicle lights
int getBlinkType ()
 Gets the blinking type. More...
 
void setBlinkType (int blink)
 Sets the blinking type. More...
 
bool getCustomLightVisible (int number)
 Returns true if the custom light with the number number is enabled. More...
 
void setCustomLightVisible (int number, bool visible)
 Enables or disables the custom light. More...
 
bool getBeaconMode ()
 Gets the mode of the beacon. More...
 
void beaconsToggle ()
 Toggles the beacons. More...
 
bool getBrakeLightVisible ()
 Returns true if the brake light is enabled. More...
 
bool getReverseLightVisible ()
 Returns true if the reverse lights are enabled. More...
 
int countCustomLights (int)
 Counts flares using the given custom light group number (1-10). More...
 
int countFlaresByType (FlareType)
 Counts flares using the given type. More...
 
int getBlinkType ()
 Gets the blinking type. More...
 
void setBlinkType (int blink)
 Sets the blinking type. More...
 
bool getCustomLightVisible (int number)
 Returns true if the custom light with the number number is enabled. More...
 
void setCustomLightVisible (int number, bool visible)
 Enables or disables the custom light. More...
 
bool getBeaconMode ()
 Gets the mode of the beacon. More...
 
void beaconsToggle ()
 Toggles the beacons. More...
 
bool getBrakeLightVisible ()
 Returns true if the brake light is enabled. More...
 
bool getReverseLightVisible ()
 Returns true if the reverse lights are enabled. More...
 
int countCustomLights (int)
 Counts flares using the given custom light group number (1-10). More...
 
int countFlaresByType (FlareType)
 Counts flares using the given type. More...
 
Organizational
string getTruckName ()
 Gets the designated name of the truck. More...
 
string getTruckFileName ()
 Gets the name of the truck definition file. More...
 
string getTruckFileResourceGroup ()
 Gets the name of the OGRE resource group where the truck definition file lives. More...
 
string getSectionConfig ()
 Gets the name of the loaded section for a truck. More...
 
int getInstanceId ()
 Gets the unique Actor Instance ID; The same value as provided by Game2Script::eventCallbackEx(). More...
 
string getTruckName ()
 Gets the designated name of the truck. More...
 
string getTruckFileName ()
 Gets the name of the truck definition file. More...
 
string getTruckFileResourceGroup ()
 Gets the name of the OGRE resource group where the truck definition file lives. More...
 
string getSectionConfig ()
 Gets the name of the loaded section for a truck. More...
 
int getInstanceId ()
 Gets the unique Actor Instance ID; The same value as provided by Game2Script::eventCallbackEx(). More...
 

Detailed Description

Binding of RoR::Actor; a softbody-physics gameplay object, can be anything from soda can to space shuttle.

Definition at line 15 of file BeamClass.h.

Member Function Documentation

◆ antilockbrakeToggle() [1/2]

void Script2Game::BeamClass::antilockbrakeToggle ( )

Toggles the anti-lock brakes.

◆ antilockbrakeToggle() [2/2]

void Script2Game::BeamClass::antilockbrakeToggle ( )

Toggles the anti-lock brakes.

◆ beaconsToggle() [1/2]

void Script2Game::BeamClass::beaconsToggle ( )

Toggles the beacons.

◆ beaconsToggle() [2/2]

void Script2Game::BeamClass::beaconsToggle ( )

Toggles the beacons.

◆ clearForcedCinecam() [1/2]

void Script2Game::BeamClass::clearForcedCinecam ( )

Resets the effect of setForcedCinecam();.

◆ clearForcedCinecam() [2/2]

void Script2Game::BeamClass::clearForcedCinecam ( )

Resets the effect of setForcedCinecam();.

◆ countCustomLights() [1/2]

int Script2Game::BeamClass::countCustomLights ( int  )

Counts flares using the given custom light group number (1-10).

◆ countCustomLights() [2/2]

int Script2Game::BeamClass::countCustomLights ( int  )

Counts flares using the given custom light group number (1-10).

◆ countFlaresByType() [1/2]

int Script2Game::BeamClass::countFlaresByType ( FlareType  )

Counts flares using the given type.

◆ countFlaresByType() [2/2]

int Script2Game::BeamClass::countFlaresByType ( FlareType  )

Counts flares using the given type.

◆ getBeaconMode() [1/2]

bool Script2Game::BeamClass::getBeaconMode ( )

Gets the mode of the beacon.

◆ getBeaconMode() [2/2]

bool Script2Game::BeamClass::getBeaconMode ( )

Gets the mode of the beacon.

◆ getBlinkType() [1/2]

int Script2Game::BeamClass::getBlinkType ( )

Gets the blinking type.

See also
blinktype

◆ getBlinkType() [2/2]

int Script2Game::BeamClass::getBlinkType ( )

Gets the blinking type.

See also
blinktype

◆ getBrakeLightVisible() [1/2]

bool Script2Game::BeamClass::getBrakeLightVisible ( )

Returns true if the brake light is enabled.

◆ getBrakeLightVisible() [2/2]

bool Script2Game::BeamClass::getBrakeLightVisible ( )

Returns true if the brake light is enabled.

◆ getCustomLightVisible() [1/2]

bool Script2Game::BeamClass::getCustomLightVisible ( int  number)

Returns true if the custom light with the number number is enabled.

◆ getCustomLightVisible() [2/2]

bool Script2Game::BeamClass::getCustomLightVisible ( int  number)

Returns true if the custom light with the number number is enabled.

◆ getCustomParticleMode() [1/2]

bool Script2Game::BeamClass::getCustomParticleMode ( )

Gets the custom particles mode.

◆ getCustomParticleMode() [2/2]

bool Script2Game::BeamClass::getCustomParticleMode ( )

Gets the custom particles mode.

◆ getEngine() [1/2]

EngineClassPtr Script2Game::BeamClass::getEngine ( )

Retrieve engine/transmission simulator.

◆ getEngine() [2/2]

EngineClassPtr Script2Game::BeamClass::getEngine ( )

Retrieve engine/transmission simulator.

◆ getForcedCinecam() [1/2]

bool Script2Game::BeamClass::getForcedCinecam ( int &  inout,
int &  inout 
)

Reports the values submitted by setForcedCinecam();.

Parameters
cinecamIdCinecams are numbered from 0, use getNumCinecams(); -1 means no cinecam.
flagsFlags are reserved for future use.
Returns
True if a forced camera was set, False if not.

◆ getForcedCinecam() [2/2]

bool Script2Game::BeamClass::getForcedCinecam ( int &  inout,
int &  inout 
)

Reports the values submitted by setForcedCinecam();.

Parameters
cinecamIdCinecams are numbered from 0, use getNumCinecams(); -1 means no cinecam.
flagsFlags are reserved for future use.
Returns
True if a forced camera was set, False if not.

◆ getGForces() [1/2]

vector3 Script2Game::BeamClass::getGForces ( )

Gets the G-forces that this truck is currently experiencing.

Returns
a vector3 representing the G-forces

◆ getGForces() [2/2]

vector3 Script2Game::BeamClass::getGForces ( )

Gets the G-forces that this truck is currently experiencing.

Returns
a vector3 representing the G-forces

◆ getHeadingDirectionAngle() [1/2]

float Script2Game::BeamClass::getHeadingDirectionAngle ( )

Returns the angle in which the truck is heading.

◆ getHeadingDirectionAngle() [2/2]

float Script2Game::BeamClass::getHeadingDirectionAngle ( )

Returns the angle in which the truck is heading.

◆ getInstanceId() [1/2]

int Script2Game::BeamClass::getInstanceId ( )

Gets the unique Actor Instance ID; The same value as provided by Game2Script::eventCallbackEx().

◆ getInstanceId() [2/2]

int Script2Game::BeamClass::getInstanceId ( )

Gets the unique Actor Instance ID; The same value as provided by Game2Script::eventCallbackEx().

◆ getNodeCount() [1/2]

int Script2Game::BeamClass::getNodeCount ( )

Gets the total amount of nodes of the truck.

◆ getNodeCount() [2/2]

int Script2Game::BeamClass::getNodeCount ( )

Gets the total amount of nodes of the truck.

◆ getNodePosition() [1/2]

vector3 Script2Game::BeamClass::getNodePosition ( int  nodeNumber)

Returns the position of the node.

Parameters
thenumber of the node (counts from 0, see getNodeCount())
Returns
vector3 of the world position for the node

◆ getNodePosition() [2/2]

vector3 Script2Game::BeamClass::getNodePosition ( int  nodeNumber)

Returns the position of the node.

Parameters
thenumber of the node (counts from 0, see getNodeCount())
Returns
vector3 of the world position for the node

◆ getNumCinecams() [1/2]

int Script2Game::BeamClass::getNumCinecams ( ) const

Reports number of installed cinecams.

◆ getNumCinecams() [2/2]

int Script2Game::BeamClass::getNumCinecams ( ) const

Reports number of installed cinecams.

◆ getOrientation() [1/2]

quaternion Script2Game::BeamClass::getOrientation ( )

Orientation on all axes packed to single quaternion.

Use getYaw(), getPitch() and getRoll() for individual rotations in radians. Meters per second.

◆ getOrientation() [2/2]

quaternion Script2Game::BeamClass::getOrientation ( )

Orientation on all axes packed to single quaternion.

Use getYaw(), getPitch() and getRoll() for individual rotations in radians. Meters per second.

◆ getPosition() [1/2]

vector3 Script2Game::BeamClass::getPosition ( )

Get vehicle absolute position.

◆ getPosition() [2/2]

vector3 Script2Game::BeamClass::getPosition ( )

Get vehicle absolute position.

◆ getReverseLightVisible() [1/2]

bool Script2Game::BeamClass::getReverseLightVisible ( )

Returns true if the reverse lights are enabled.

◆ getReverseLightVisible() [2/2]

bool Script2Game::BeamClass::getReverseLightVisible ( )

Returns true if the reverse lights are enabled.

◆ getRotation() [1/2]

float Script2Game::BeamClass::getRotation ( )

Returns the angle in which the truck is heading.

◆ getRotation() [2/2]

float Script2Game::BeamClass::getRotation ( )

Returns the angle in which the truck is heading.

◆ getSectionConfig() [1/2]

string Script2Game::BeamClass::getSectionConfig ( )

Gets the name of the loaded section for a truck.

◆ getSectionConfig() [2/2]

string Script2Game::BeamClass::getSectionConfig ( )

Gets the name of the loaded section for a truck.

◆ getSimAttribute() [1/2]

float Script2Game::BeamClass::getSimAttribute ( ActorSimAttr  attr)

◆ getSimAttribute() [2/2]

float Script2Game::BeamClass::getSimAttribute ( ActorSimAttr  attr)

◆ getTotalMass() [1/2]

float Script2Game::BeamClass::getTotalMass ( bool  withLocked)

Gets the total mass of the truck.

Parameters
withLockedif true, the mass of everything locked to the truck will be added to the mass of the truck.

◆ getTotalMass() [2/2]

float Script2Game::BeamClass::getTotalMass ( bool  withLocked)

Gets the total mass of the truck.

Parameters
withLockedif true, the mass of everything locked to the truck will be added to the mass of the truck.

◆ getTruckFileName() [1/2]

string Script2Game::BeamClass::getTruckFileName ( )

Gets the name of the truck definition file.

◆ getTruckFileName() [2/2]

string Script2Game::BeamClass::getTruckFileName ( )

Gets the name of the truck definition file.

◆ getTruckFileResourceGroup() [1/2]

string Script2Game::BeamClass::getTruckFileResourceGroup ( )

Gets the name of the OGRE resource group where the truck definition file lives.

Useful for loading using GenericDocumentClass.

◆ getTruckFileResourceGroup() [2/2]

string Script2Game::BeamClass::getTruckFileResourceGroup ( )

Gets the name of the OGRE resource group where the truck definition file lives.

Useful for loading using GenericDocumentClass.

◆ getTruckName() [1/2]

string Script2Game::BeamClass::getTruckName ( )

Gets the designated name of the truck.

◆ getTruckName() [2/2]

string Script2Game::BeamClass::getTruckName ( )

Gets the designated name of the truck.

◆ getTruckState() [1/2]

TruckState Script2Game::BeamClass::getTruckState ( )

◆ getTruckState() [2/2]

TruckState Script2Game::BeamClass::getTruckState ( )

◆ getVehicleAI() [1/2]

VehicleAiClass Script2Game::BeamClass::getVehicleAI ( )

Retrieve the waypoint AI object.

◆ getVehicleAI() [2/2]

VehicleAiClass Script2Game::BeamClass::getVehicleAI ( )

Retrieve the waypoint AI object.

◆ getVehiclePosition() [1/2]

vector3 Script2Game::BeamClass::getVehiclePosition ( )

◆ getVehiclePosition() [2/2]

vector3 Script2Game::BeamClass::getVehiclePosition ( )

◆ getWheelNodeCount() [1/2]

int Script2Game::BeamClass::getWheelNodeCount ( )

Gets the total amount of nodes of the wheels of the truck.

◆ getWheelNodeCount() [2/2]

int Script2Game::BeamClass::getWheelNodeCount ( )

Gets the total amount of nodes of the wheels of the truck.

◆ getWheelSpeed() [1/2]

float Script2Game::BeamClass::getWheelSpeed ( )

Gets the current wheel speed of the vehicle.

◆ getWheelSpeed() [2/2]

float Script2Game::BeamClass::getWheelSpeed ( )

Gets the current wheel speed of the vehicle.

◆ isLocked() [1/2]

bool Script2Game::BeamClass::isLocked ( )

Returns true if a hook of this truck is locked.

◆ isLocked() [2/2]

bool Script2Game::BeamClass::isLocked ( )

Returns true if a hook of this truck is locked.

◆ isNodeWheelRim() [1/2]

vector3 Script2Game::BeamClass::isNodeWheelRim ( int  nodeNumber)

Is node marked as wheel rim? Note some wheel models use only tire nodes.

See https://docs.rigsofrods.org/vehicle-creation/fileformat-truck/#wheels

Parameters
thenumber of the node (counts from 0, see getNodeCount())
Returns
True if the node is a wheel rim.

◆ isNodeWheelRim() [2/2]

vector3 Script2Game::BeamClass::isNodeWheelRim ( int  nodeNumber)

Is node marked as wheel rim? Note some wheel models use only tire nodes.

See https://docs.rigsofrods.org/vehicle-creation/fileformat-truck/#wheels

Parameters
thenumber of the node (counts from 0, see getNodeCount())
Returns
True if the node is a wheel rim.

◆ isNodeWheelTire() [1/2]

vector3 Script2Game::BeamClass::isNodeWheelTire ( int  nodeNumber)

Is node marked as wheel tire? Note some wheel models use only tire nodes.

See https://docs.rigsofrods.org/vehicle-creation/fileformat-truck/#wheels

Parameters
thenumber of the node (counts from 0, see getNodeCount())
Returns
True if this is a tire node.

◆ isNodeWheelTire() [2/2]

vector3 Script2Game::BeamClass::isNodeWheelTire ( int  nodeNumber)

Is node marked as wheel tire? Note some wheel models use only tire nodes.

See https://docs.rigsofrods.org/vehicle-creation/fileformat-truck/#wheels

Parameters
thenumber of the node (counts from 0, see getNodeCount())
Returns
True if this is a tire node.

◆ parkingbrakeToggle() [1/2]

void Script2Game::BeamClass::parkingbrakeToggle ( )

Toggles the parking brake.

◆ parkingbrakeToggle() [2/2]

void Script2Game::BeamClass::parkingbrakeToggle ( )

Toggles the parking brake.

◆ reset() [1/2]

void Script2Game::BeamClass::reset ( bool  keep_position)

Resets the truck.

Parameters
reset_positiontrue if you want to keep the truck at the current position. (otherwise, it will be moved to its origin position)

◆ reset() [2/2]

void Script2Game::BeamClass::reset ( bool  keep_position)

Resets the truck.

Parameters
reset_positiontrue if you want to keep the truck at the current position. (otherwise, it will be moved to its origin position)

◆ scaleTruck() [1/2]

void Script2Game::BeamClass::scaleTruck ( float  ratio)

Scales the truck.

◆ scaleTruck() [2/2]

void Script2Game::BeamClass::scaleTruck ( float  ratio)

Scales the truck.

◆ setBlinkType() [1/2]

void Script2Game::BeamClass::setBlinkType ( int  blink)

Sets the blinking type.

See also
blinktype

◆ setBlinkType() [2/2]

void Script2Game::BeamClass::setBlinkType ( int  blink)

Sets the blinking type.

See also
blinktype

◆ setCustomLightVisible() [1/2]

void Script2Game::BeamClass::setCustomLightVisible ( int  number,
bool  visible 
)

Enables or disables the custom light.

◆ setCustomLightVisible() [2/2]

void Script2Game::BeamClass::setCustomLightVisible ( int  number,
bool  visible 
)

Enables or disables the custom light.

◆ setForcedCinecam() [1/2]

void Script2Game::BeamClass::setForcedCinecam ( int  cinecamId,
int  flags 
)

Sets a forced cinecam for this actor; This disables camera hotkeys.

Parameters
cinecamIdCinecams are numbered from 0, use getNumCinecams(); -1 means no cinecam.
flagsFlags are reserved for future use.

◆ setForcedCinecam() [2/2]

void Script2Game::BeamClass::setForcedCinecam ( int  cinecamId,
int  flags 
)

Sets a forced cinecam for this actor; This disables camera hotkeys.

Parameters
cinecamIdCinecams are numbered from 0, use getNumCinecams(); -1 means no cinecam.
flagsFlags are reserved for future use.

◆ setMass() [1/2]

void Script2Game::BeamClass::setMass ( float  m)

Sets the mass of the truck.

◆ setMass() [2/2]

void Script2Game::BeamClass::setMass ( float  m)

Sets the mass of the truck.

◆ setSimAttribute() [1/2]

void Script2Game::BeamClass::setSimAttribute ( ActorSimAttr  attr,
float  val 
)

Allows advanced users to set physics settings directly, including some not accessible from rig-def file format.

HAZARDOUS - values may not be checked; Pay attention to 'safe values' at each attribute description.

◆ setSimAttribute() [2/2]

void Script2Game::BeamClass::setSimAttribute ( ActorSimAttr  attr,
float  val 
)

Allows advanced users to set physics settings directly, including some not accessible from rig-def file format.

HAZARDOUS - values may not be checked; Pay attention to 'safe values' at each attribute description.

◆ toggleCustomParticles() [1/2]

void Script2Game::BeamClass::toggleCustomParticles ( )

Toggles the custom particles.

◆ toggleCustomParticles() [2/2]

void Script2Game::BeamClass::toggleCustomParticles ( )

Toggles the custom particles.

◆ tractioncontrolToggle() [1/2]

void Script2Game::BeamClass::tractioncontrolToggle ( )

Toggles the tracktion control.

◆ tractioncontrolToggle() [2/2]

void Script2Game::BeamClass::tractioncontrolToggle ( )

Toggles the tracktion control.


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