Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
trax::Body Struct Referenceabstract

A dynamic object in physical space. More...

#include <C:/Trend/Development/Trax3/Code/trax/rigid/Body.h>

Inheritance diagram for trax::Body:

Public Member Functions

virtual void SetName (const char *name) noexcept=0
 Sets the name of the Body.
virtual const char * GetName () const noexcept=0
virtual void SetFrame (const spat::Frame< Length, One > &frame) noexcept=0
 Sets position and orientation (pose) in global coordinates.
virtual void GetFrame (spat::Frame< Length, One > &frame) const noexcept=0
 Gets the pose in global coordinates.
virtual void WakeUp ()=0
 Wakes the Body if it was deactivated due to not being in move.
virtual bool IsSleeping () const noexcept=0
 Is the body deactivated?
virtual void SetSleepDelay (Time threshold)=0
virtual Time GetSleepDelay () const noexcept=0
virtual void SetSleepThreshold (decltype(Velocity{} *Velocity{}) threshold)=0
virtual decltype(Velocity{} *Velocity{}) GetSleepThreshold () const noexcept=0
virtual void SetMass (Mass mass)=0
 Sets the mass of the Body.
virtual Mass GetMass () const noexcept=0
virtual void CenterOfMass (const spat::Position< Length > &pos) noexcept=0
 Sets the center of mass in Body space.
virtual spat::Position< LengthCenterOfMass () const noexcept=0
virtual void InertiaTensor (const spat::SquareMatrix< Area, 3 > &specificInertiaTensor)=0
 Sets the specific inertia tensor of the Body.
virtual spat::SquareMatrix< Area, 3 > InertiaTensor () const =0
virtual void SetLinearVelocity (const spat::Vector< Velocity > &v)=0
 Sets the velocity of the barycenter of this Body.
virtual void GetLinearVelocity (spat::Vector< Velocity > &v) const =0
 Gets the velocity of the barycenter of this Body.
virtual void SetAngularVelocity (const spat::Vector< AngularVelocity > &w)=0
 Sets the rotational velocity around the barycenter of this Body.
virtual void GetAngularVelocity (spat::Vector< AngularVelocity > &w) const =0
 Sets the rotational velocity around the barycenter of this Body.

Detailed Description

A dynamic object in physical space.

For a good introduction in dynamics of solid bodies see Landau/Lifschitz, Mechanics Vol I, Nauka, Moskau.

Member Function Documentation

◆ CenterOfMass()

virtual spat::Position< Length > trax::Body::CenterOfMass ( ) const
pure virtualnoexcept
Returns
The center of mass in body space.

◆ GetFrame()

virtual void trax::Body::GetFrame ( spat::Frame< Length, One > & frame) const
pure virtualnoexcept

Gets the pose in global coordinates.

Implemented in trax::Gestalt.

◆ GetMass()

virtual Mass trax::Body::GetMass ( ) const
pure virtualnoexcept
Returns
The mass of the Body.

◆ GetName()

virtual const char * trax::Body::GetName ( ) const
pure virtualnoexcept
Returns
The name of the Body.

Implemented in trax::Gestalt.

◆ InertiaTensor() [1/2]

virtual spat::SquareMatrix< Area, 3 > trax::Body::InertiaTensor ( ) const
pure virtual
Returns
the inertia tensor of the Body.

◆ InertiaTensor() [2/2]

virtual void trax::Body::InertiaTensor ( const spat::SquareMatrix< Area, 3 > & specificInertiaTensor)
pure virtual

Sets the specific inertia tensor of the Body.

The elements of the tensor are assumed to be calculated relative to the center of mass but in Body space regarding the rotations (so a frame of reference parallel to the Body's but with CoM as its origin). Furthermore the tensor is assumed to be calculated for a body of total mass 1, i.e. we need the intertia tensor divided by the total mass of the body. This way mass, CoM and inertia tensor can get specified independently of each other. There exist helper funtions for calculating the tensor.

See also
CalculateMassPropertiesFromShapes
SpecificInertiaTensorFor

◆ SetAngularVelocity()

virtual void trax::Body::SetAngularVelocity ( const spat::Vector< AngularVelocity > & w)
pure virtual

Sets the rotational velocity around the barycenter of this Body.

This will be a momentary velocity that will change over time due to simulation events. This should only get used to set a certain starting velocity, e.g. after inserting a RailRunner into the scene, constant reset of velocity will result in unstable simulation.

◆ SetFrame()

virtual void trax::Body::SetFrame ( const spat::Frame< Length, One > & frame)
pure virtualnoexcept

Sets position and orientation (pose) in global coordinates.

This will set the position and orientation of the Body in global simulation space.

Parameters
frameFrame of reference. Must be orthonormal.

Implemented in trax::Gestalt.

◆ SetLinearVelocity()

virtual void trax::Body::SetLinearVelocity ( const spat::Vector< Velocity > & v)
pure virtual

Sets the velocity of the barycenter of this Body.

This will be a momentary velocity that will change over time due to simulation events. This should only get used to set a certain starting velocity, e.g. after inserting a Body into the scene, constant reset of velocity will result in unstable simulation.

◆ SetMass()

virtual void trax::Body::SetMass ( Mass mass)
pure virtual

Sets the mass of the Body.

This only sets the mass but lets the distribution of it unchanged.

Parameters
massMass to set for the Body. Must be > 0.
Exceptions
std::invalid_argumentif the mass is < 0kg.

◆ SetName()

virtual void trax::Body::SetName ( const char * name)
pure virtualnoexcept

Sets the name of the Body.

This is for debug purposes; the string is not copied, only the pointer is stored.

Implemented in trax::Gestalt.


The documentation for this struct was generated from the following file:
  • C:/Trend/Development/Trax3/Code/trax/rigid/Body.h