The physics element specifies the type and properties of a dynamics engine.
More...
#include <Physics.hh>
|
| Physics () |
| Default constructor.
|
|
sdf::ElementPtr | Element () const |
| Get a pointer to the SDF element that was used during load.
|
|
std::string | EngineType () const |
| Get the physics profile dynamics engine type.
|
|
bool | IsDefault () const |
| Get whether this physics profile is marked as default.
|
|
Errors | Load (ElementPtr _sdf) |
| Load the physics based on an element pointer.
|
|
int | MaxContacts () const |
| Get the maximum number of contacts allowed between two entities.
|
|
double | MaxStepSize () const |
| Get the max step size in seconds.
|
|
std::string | Name () const |
| Get the name of this set of physics parameters.
|
|
double | RealTimeFactor () const |
| Get the target real time factor.
|
|
void | SetDefault (const bool _default) |
| Set whether this physics profile is the default.
|
|
void | SetEngineType (const std::string &_type) |
| Set the physics profile dynamics engine type.
|
|
void | SetMaxContacts (int _maxContacts) |
| Set the maximum number of contacts allowed between two entities.
|
|
void | SetMaxStepSize (const double _step) |
| Set the max step size in seconds.
|
|
void | SetName (const std::string &_name) |
| Set the name of this set of physics parameters.
|
|
void | SetRealTimeFactor (const double _factor) |
| Set the target realtime factor.
|
|
sdf::ElementPtr | ToElement () const |
| Create and return an SDF element filled with data from this physics.
|
|
sdf::ElementPtr | ToElement (sdf::Errors &_errors) const |
| Create and return an SDF element filled with data from this physics.
|
|
The physics element specifies the type and properties of a dynamics engine.
◆ Physics()
sdf::SDF_VERSION_NAMESPACE::Physics::Physics |
( |
| ) |
|
◆ Element()
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()
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
-
- 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] | _default | True 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] | _type | The 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] | _maxContacts | Maximum number of contacts. |
◆ SetMaxStepSize()
void sdf::SDF_VERSION_NAMESPACE::Physics::SetMaxStepSize |
( |
const double |
_step | ) |
|
Set the max step size in seconds.
- Parameters
-
[in] | _step | The 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] | _name | Name of the physics profile. |
◆ SetRealTimeFactor()
void sdf::SDF_VERSION_NAMESPACE::Physics::SetRealTimeFactor |
( |
const double |
_factor | ) |
|
Set the target realtime factor.
- Parameters
-
[in] | _factor | The target real time factor. |
◆ ToElement() [1/2]
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]
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] | _errors | Vector of errors. |
- Returns
- SDF element pointer with updated physics values.
The documentation for this class was generated from the following file: