Public Member Functions | List of all members
sdf::v9::Physics Class Reference

The physics element specifies the type and properties of a dynamics engine. More...

#include <Physics.hh>

Public Member Functions

 Physics ()
 Default constructor. More...
 
 Physics (const Physics &_physics)
 Copy constructor. More...
 
 Physics (Physics &&_physics) noexcept
 Move constructor. More...
 
 ~Physics ()
 Destructor. More...
 
sdf::ElementPtr Element () const
 Get a pointer to the SDF element that was used during load. More...
 
std::string EngineType () const
 Get the physics profile dynamics engine type. More...
 
bool IsDefault () const
 Get whether this physics profile is marked as default. More...
 
Errors Load (ElementPtr _sdf)
 Load the physics based on an element pointer. More...
 
double MaxStepSize () const
 Get the max step size in seconds. More...
 
std::string Name () const
 Get the name of this set of physics parameters. More...
 
Physicsoperator= (const Physics &_physics)
 Copy assignment operator. More...
 
Physicsoperator= (Physics &&_physics)
 Move assignment operator. More...
 
double RealTimeFactor () const
 Get the target real time factor. More...
 
void SetDefault (const bool _default) const
 Set whether this physics profile is the default. More...
 
void SetEngineType (const std::string &_type)
 Set the physics profile dynamics engine type. More...
 
void SetMaxStepSize (const double _step)
 Set the max step size in seconds. More...
 
void SetName (const std::string &_name) const
 Set the name of this set of physics parameters. More...
 
void SetRealTimeFactor (const double _factor)
 Set the target realtime factor. More...
 

Detailed Description

The physics element specifies the type and properties of a dynamics engine.

Constructor & Destructor Documentation

◆ Physics() [1/3]

sdf::v9::Physics::Physics ( )

Default constructor.

◆ Physics() [2/3]

sdf::v9::Physics::Physics ( const Physics _physics)

Copy constructor.

Parameters
[in]_physicsPhysics to copy.

◆ Physics() [3/3]

sdf::v9::Physics::Physics ( Physics &&  _physics)
noexcept

Move constructor.

Parameters
[in]_physicsPhysics to move.

◆ ~Physics()

sdf::v9::Physics::~Physics ( )

Destructor.

Member Function Documentation

◆ Element()

sdf::ElementPtr sdf::v9::Physics::Element ( ) const

Get a pointer to the SDF element that was used during load.

Returns
SDF element pointer. The value will be nullptr if Load has not been called.

◆ EngineType()

std::string sdf::v9::Physics::EngineType ( ) const

Get the physics profile dynamics engine type.

Current options are ode, bullet, simbody and dart. Defaults to ode if left unspecified.

Returns
The type of dynamics engine.

◆ IsDefault()

bool sdf::v9::Physics::IsDefault ( ) const

Get whether this physics profile is marked as default.

If true, this physics profile is set as the default physics profile for the World. If multiple default physics elements exist, the first physics profile marked as default is chosen. If no default physics element exists, the first physics element is chosen.

Returns
True if this profile is the default.

◆ Load()

Errors sdf::v9::Physics::Load ( ElementPtr  _sdf)

Load the physics based on an element pointer.

This is not the usual entry point. Typical usage of the SDF DOM is through the Root object.

Parameters
[in]_sdfThe SDF Element pointer
Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

◆ MaxStepSize()

double sdf::v9::Physics::MaxStepSize ( ) const

Get the max step size in seconds.

The Maximum time step size at which every system in simulation can interact with the states of the world.

Returns
The max step size in seconds.

◆ Name()

std::string sdf::v9::Physics::Name ( ) const

Get the name of this set of physics parameters.

Returns
Name of the physics profile.

◆ operator=() [1/2]

Physics& sdf::v9::Physics::operator= ( const Physics _physics)

Copy assignment operator.

Parameters
[in]_physicsPhysics to copy.
Returns
Reference to this.

◆ operator=() [2/2]

Physics& sdf::v9::Physics::operator= ( Physics &&  _physics)

Move assignment operator.

Parameters
[in]_physicsPhysics to move.
Returns
Reference to this.

◆ RealTimeFactor()

double sdf::v9::Physics::RealTimeFactor ( ) const

Get the target real time factor.

Target simulation speedup factor, defined by ratio of simulation time to real-time.

Returns
The target real time factor.

◆ SetDefault()

void sdf::v9::Physics::SetDefault ( const bool  _default) const

Set whether this physics profile is the default.

Parameters
[in]_defaultTrue to make this profile default.

◆ SetEngineType()

void sdf::v9::Physics::SetEngineType ( const std::string &  _type)

Set the physics profile dynamics engine type.

Parameters
[in]_typeThe type of dynamics engine.

◆ SetMaxStepSize()

void sdf::v9::Physics::SetMaxStepSize ( const double  _step)

Set the max step size in seconds.

Parameters
[in]_stepThe max step size in seconds.

◆ SetName()

void sdf::v9::Physics::SetName ( const std::string &  _name) const

Set the name of this set of physics parameters.

Parameters
[in]_nameName of the physics profile.

◆ SetRealTimeFactor()

void sdf::v9::Physics::SetRealTimeFactor ( const double  _factor)

Set the target realtime factor.

Parameters
[in]_factorThe target real time factor.

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