Public Member Functions | List of all members
sdf::SDF_VERSION_NAMESPACE::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...
 
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...
 
int MaxContacts () const
 Get the maximum number of contacts allowed between two entities. 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...
 
double RealTimeFactor () const
 Get the target real time factor. More...
 
void SetDefault (const bool _default)
 Set whether this physics profile is the default. More...
 
void SetEngineType (const std::string &_type)
 Set the physics profile dynamics engine type. More...
 
void SetMaxContacts (int _maxContacts)
 Set the maximum number of contacts allowed between two entities. More...
 
void SetMaxStepSize (const double _step)
 Set the max step size in seconds. More...
 
void SetName (const std::string &_name)
 Set the name of this set of physics parameters. More...
 
void SetRealTimeFactor (const double _factor)
 Set the target realtime factor. More...
 
sdf::ElementPtr ToElement () const
 Create and return an SDF element filled with data from this physics. More...
 
sdf::ElementPtr ToElement (sdf::Errors &_errors) const
 Create and return an SDF element filled with data from this physics. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Physics()

sdf::SDF_VERSION_NAMESPACE::Physics::Physics ( )

Default constructor.

Member Function Documentation

◆ Element()

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::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.

◆ MaxContacts()

int sdf::SDF_VERSION_NAMESPACE::Physics::MaxContacts ( ) const

Get the maximum number of contacts allowed between two entities.

This value can be overridden by a max_contacts element in a collision element.

Returns
Maximum number of contacts.

◆ MaxStepSize()

double sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::Physics::Name ( ) const

Get the name of this set of physics parameters.

Returns
Name of the physics profile.

◆ RealTimeFactor()

double sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::Physics::SetDefault ( const bool  _default)

Set whether this physics profile is the default.

Parameters
[in]_defaultTrue to make this profile default.

◆ SetEngineType()

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

Set the physics profile dynamics engine type.

Parameters
[in]_typeThe type of dynamics engine.

◆ SetMaxContacts()

void sdf::SDF_VERSION_NAMESPACE::Physics::SetMaxContacts ( int  _maxContacts)

Set the maximum number of contacts allowed between two entities.

This value can be overridden by a max_contacts element in a collision element.

Parameters
[in]_maxContactsMaximum number of contacts.

◆ SetMaxStepSize()

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

Set the max step size in seconds.

Parameters
[in]_stepThe max step size in seconds.

◆ SetName()

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

Set the name of this set of physics parameters.

Parameters
[in]_nameName of the physics profile.

◆ SetRealTimeFactor()

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

Set the target realtime factor.

Parameters
[in]_factorThe target real time factor.

◆ ToElement() [1/2]

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Physics::ToElement ( ) const

Create and return an SDF element filled with data from this physics.

Note that parameter passing functionality is not captured with this function.

Returns
SDF element pointer with updated physics values.

◆ ToElement() [2/2]

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Physics::ToElement ( sdf::Errors _errors) const

Create and return an SDF element filled with data from this physics.

Note that parameter passing functionality is not captured with this function.

Parameters
[out]_errorsVector of errors.
Returns
SDF element pointer with updated physics values.

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