Public Member Functions | List of all members
sdf::SDF_VERSION_NAMESPACE::World Class Reference

#include <World.hh>

Public Member Functions

 World ()
 Default constructor. More...
 
const ActorActorByIndex (const uint64_t _index) const
 Get an actor based on an index. More...
 
ActorActorByIndex (uint64_t _index)
 Get a mutable actor based on an index. More...
 
ActorActorByName (const std::string &_name)
 Get a mutable actor based on a name. More...
 
const ActorActorByName (const std::string &_name) const
 Get an actor based on a name. More...
 
uint64_t ActorCount () const
 Get the number of actors. More...
 
bool ActorNameExists (const std::string &_name) const
 Get whether an actor name exists. More...
 
bool AddActor (const Actor &_actor)
 Add an actor to the world. More...
 
bool AddFrame (const Frame &_frame)
 Add a frame object to the world. More...
 
bool AddJoint (const Joint &_joint)
 Add a joint to the world. More...
 
bool AddLight (const Light &_light)
 Add a light to the world. More...
 
bool AddModel (const Model &_model)
 Add a model to the world. More...
 
bool AddPhysics (const Physics &_physics)
 Add a physics object to the world. More...
 
void AddPlugin (const Plugin &_plugin)
 Add a plugin to this object. More...
 
const sdf::AtmosphereAtmosphere () const
 Get a pointer to the atmosphere model associated with this world. More...
 
std::string AudioDevice () const
 Get the audio device name. More...
 
void ClearActors ()
 Remove all actors. More...
 
void ClearFrames ()
 Remove all frames. More...
 
void ClearJoints ()
 Remove all joints. More...
 
void ClearLights ()
 Remove all lights. More...
 
void ClearModels ()
 Remove all models. More...
 
void ClearPhysics ()
 Remove all physics. More...
 
void ClearPlugins ()
 Remove all plugins. More...
 
sdf::ElementPtr Element () const
 Get a pointer to the SDF element that was used during load. More...
 
const FrameFrameByIndex (const uint64_t _index) const
 Get an immediate (not nested) child explicit frame based on an index. More...
 
FrameFrameByIndex (uint64_t _index)
 Get a mutable immediate (not nested) child explicit frame based on an index. More...
 
FrameFrameByName (const std::string &_name)
 Get a mutable explicit frame based on a name. More...
 
const FrameFrameByName (const std::string &_name) const
 Get an explicit frame based on a name. More...
 
uint64_t FrameCount () const
 Get the number of explicit frames that are immediate (not nested) children of this World object. More...
 
bool FrameNameExists (const std::string &_name) const
 Get whether an explicit frame name exists. More...
 
gz::math::Vector3d Gravity () const
 Get the acceleration due to gravity. More...
 
const sdf::GuiGui () const
 Get a pointer to the Gui associated with this world. More...
 
std::shared_ptr< const InterfaceModelInterfaceModelByIndex (const uint64_t _index) const
 Get an immediate (not recursively nested) child interface model based on an index. More...
 
uint64_t InterfaceModelCount () const
 Get the number of nested interface models that are immediate (not recursively nested) children of this World object. More...
 
const NestedIncludeInterfaceModelNestedIncludeByIndex (const uint64_t _index) const
 Get the nested include information of an immediate (not recursively nested) child interface model based on an index. More...
 
JointJointByIndex (uint64_t _index)
 Get a mutable joint based on an index. More...
 
const JointJointByIndex (uint64_t _index) const
 Get a joint based on an index. More...
 
JointJointByName (const std::string &_name)
 Get a mutable joint based on a name. More...
 
const JointJointByName (const std::string &_name) const
 Get an joint based on a name. More...
 
uint64_t JointCount () const
 Get the number of joints. More...
 
bool JointNameExists (const std::string &_name) const
 Get whether a joint name exists. More...
 
const LightLightByIndex (const uint64_t _index) const
 Get a light based on an index. More...
 
LightLightByIndex (uint64_t _index)
 Get a mutable light based on an index. More...
 
uint64_t LightCount () const
 Get the number of lights. More...
 
bool LightNameExists (const std::string &_name) const
 Get whether a light name exists. More...
 
Errors Load (ElementPtr _sdf)
 Load the world based on a element pointer. More...
 
Errors Load (sdf::ElementPtr _sdf, const ParserConfig &_config)
 Load the world based on a element pointer. More...
 
gz::math::Vector3d MagneticField () const
 Get the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinates property. More...
 
const ModelModelByIndex (const uint64_t _index) const
 Get an immediate (not recursively nested) child model based on an index. More...
 
ModelModelByIndex (uint64_t _index)
 Get an immediate (not recursively nested) mutable child model based on an index. More...
 
ModelModelByName (const std::string &_name)
 Get a mutable model based on a name. More...
 
const ModelModelByName (const std::string &_name) const
 Get a model based on a name. More...
 
uint64_t ModelCount () const
 Get the number of models that are immediate (not nested) children of this World object. More...
 
bool ModelNameExists (const std::string &_name) const
 Get whether a model name exists. More...
 
std::string Name () const
 Get the name of the world. More...
 
bool NameExistsInFrameAttachedToGraph (const std::string &_name) const
 Check if a given name exists in the FrameAttachedTo graph at the scope of the world. More...
 
const PhysicsPhysicsByIndex (const uint64_t _index) const
 Get a physics profile based on an index. More...
 
PhysicsPhysicsByIndex (uint64_t _index)
 Get a mutable physics profile based on an index. More...
 
uint64_t PhysicsCount () const
 Get the number of physics profiles. More...
 
const PhysicsPhysicsDefault () const
 Get the default physics profile. More...
 
bool PhysicsNameExists (const std::string &_name) const
 Get whether a physics profile name exists. More...
 
sdf::PluginsPlugins ()
 Get a mutable vector of plugins attached to this object. More...
 
const sdf::PluginsPlugins () const
 Get the plugins attached to this object. More...
 
void ResolveAutoInertials (sdf::Errors &_errors, const ParserConfig &_config)
 Calculate and set the inertials for all the models in the world object. More...
 
const sdf::SceneScene () const
 Get a pointer to the Scene associated with this world. More...
 
void SetAtmosphere (const sdf::Atmosphere &_atmosphere)
 Set the atmosphere model associated with this world. More...
 
void SetAudioDevice (const std::string &_device)
 Set the audio device name. More...
 
void SetGravity (const gz::math::Vector3d &_gravity)
 Set the acceleration due to gravity. More...
 
void SetGui (const sdf::Gui &_gui)
 Set the Gui parameters associated with this world. More...
 
void SetMagneticField (const gz::math::Vector3d &_mag)
 Set the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinate. More...
 
void SetName (const std::string &_name)
 Set the name of the world. More...
 
void SetScene (const sdf::Scene &_scene)
 Set the Scene parameters associated with this world. More...
 
void SetSphericalCoordinates (const gz::math::SphericalCoordinates &_coord)
 Set the spherical coordinates for the world origin. More...
 
void SetWindLinearVelocity (const gz::math::Vector3d &_wind)
 Set the wind linear velocity in the global/world coordinate frame. More...
 
const gz::math::SphericalCoordinates * SphericalCoordinates () const
 Get the spherical coordinates for the world origin. More...
 
sdf::ElementPtr ToElement (const OutputConfig &_config=OutputConfig::GlobalConfig()) const
 Create and return an SDF element filled with data from this world. More...
 
Errors ValidateGraphs () const
 Check that the FrameAttachedToGraph and PoseRelativeToGraph are valid. More...
 
gz::math::Vector3d WindLinearVelocity () const
 Get the wind linear velocity in the global/world coordinate frame. More...
 

Constructor & Destructor Documentation

◆ World()

sdf::SDF_VERSION_NAMESPACE::World::World ( )

Default constructor.

Member Function Documentation

◆ ActorByIndex() [1/2]

const Actor* sdf::SDF_VERSION_NAMESPACE::World::ActorByIndex ( const uint64_t  _index) const

Get an actor based on an index.

Parameters
[in]_indexIndex of the actor. The index should be in the range [0..ActorCount()).
Returns
Pointer to the actor. Nullptr if the index does not exist.
See also
uint64_t ActorCount() const

◆ ActorByIndex() [2/2]

Actor* sdf::SDF_VERSION_NAMESPACE::World::ActorByIndex ( uint64_t  _index)

Get a mutable actor based on an index.

Parameters
[in]_indexIndex of the actor. The index should be in the range [0..ActorCount()).
Returns
Pointer to the actor. Nullptr if the index does not exist.
See also
uint64_t ActorCount() const

◆ ActorByName() [1/2]

Actor* sdf::SDF_VERSION_NAMESPACE::World::ActorByName ( const std::string &  _name)

Get a mutable actor based on a name.

Parameters
[in]_nameName of the actor.
Returns
Pointer to the actor. Nullptr if an actor with the given name does not exist.
See also
bool ActorNameExists(const std::string &_name) const

◆ ActorByName() [2/2]

const Actor* sdf::SDF_VERSION_NAMESPACE::World::ActorByName ( const std::string &  _name) const

Get an actor based on a name.

Parameters
[in]_nameName of the actor.
Returns
Pointer to the actor. Nullptr if an actor with the given name does not exist.
See also
bool ActorNameExists(const std::string &_name) const

◆ ActorCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::World::ActorCount ( ) const

Get the number of actors.

Returns
Number of actors contained in this World object.

◆ ActorNameExists()

bool sdf::SDF_VERSION_NAMESPACE::World::ActorNameExists ( const std::string &  _name) const

Get whether an actor name exists.

Parameters
[in]_nameName of the actor to check.
Returns
True if there exists an actor with the given name.

◆ AddActor()

bool sdf::SDF_VERSION_NAMESPACE::World::AddActor ( const Actor _actor)

Add an actor to the world.

Parameters
[in]_actorActor to add.
Returns
True if successful, false if an actor with the name already exists.

◆ AddFrame()

bool sdf::SDF_VERSION_NAMESPACE::World::AddFrame ( const Frame _frame)

Add a frame object to the world.

Parameters
[in]_frameFrame to add.
Returns
True if successful, false if a frames object with the name already exists.

◆ AddJoint()

bool sdf::SDF_VERSION_NAMESPACE::World::AddJoint ( const Joint _joint)

Add a joint to the world.

Parameters
[in]_jointJoint to add.
Returns
True if successful, false if a joint with the name already exists.

◆ AddLight()

bool sdf::SDF_VERSION_NAMESPACE::World::AddLight ( const Light _light)

Add a light to the world.

Parameters
[in]_lightLight to add.
Returns
True if successful, false if a light with the name already exists.

◆ AddModel()

bool sdf::SDF_VERSION_NAMESPACE::World::AddModel ( const Model _model)

Add a model to the world.

Parameters
[in]_modelModel to add.
Returns
True if successful, false if a model with the name already exists.

◆ AddPhysics()

bool sdf::SDF_VERSION_NAMESPACE::World::AddPhysics ( const Physics _physics)

Add a physics object to the world.

Parameters
[in]_physicsPhysics to add.
Returns
True if successful, false if a physics object with the name already exists.

◆ AddPlugin()

void sdf::SDF_VERSION_NAMESPACE::World::AddPlugin ( const Plugin _plugin)

Add a plugin to this object.

Parameters
[in]_pluginPlugin to add.

◆ Atmosphere()

const sdf::Atmosphere* sdf::SDF_VERSION_NAMESPACE::World::Atmosphere ( ) const

Get a pointer to the atmosphere model associated with this world.

A nullptr indicates that an atmosphere model has not been set.

Returns
Pointer to this world's atmosphere model. Nullptr inidicates that there is no atmosphere model.

◆ AudioDevice()

std::string sdf::SDF_VERSION_NAMESPACE::World::AudioDevice ( ) const

Get the audio device name.

The audio device can be used to playback audio files. A value of "default" or an empty string indicates that the system's default audio device should be used.

Returns
Audio device name.

◆ ClearActors()

void sdf::SDF_VERSION_NAMESPACE::World::ClearActors ( )

Remove all actors.

◆ ClearFrames()

void sdf::SDF_VERSION_NAMESPACE::World::ClearFrames ( )

Remove all frames.

◆ ClearJoints()

void sdf::SDF_VERSION_NAMESPACE::World::ClearJoints ( )

Remove all joints.

◆ ClearLights()

void sdf::SDF_VERSION_NAMESPACE::World::ClearLights ( )

Remove all lights.

◆ ClearModels()

void sdf::SDF_VERSION_NAMESPACE::World::ClearModels ( )

Remove all models.

◆ ClearPhysics()

void sdf::SDF_VERSION_NAMESPACE::World::ClearPhysics ( )

Remove all physics.

◆ ClearPlugins()

void sdf::SDF_VERSION_NAMESPACE::World::ClearPlugins ( )

Remove all plugins.

◆ Element()

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

◆ FrameByIndex() [1/2]

const Frame* sdf::SDF_VERSION_NAMESPACE::World::FrameByIndex ( const uint64_t  _index) const

Get an immediate (not nested) child explicit frame based on an index.

Parameters
[in]_indexIndex of the explicit frame. The index should be in the range [0..FrameCount()).
Returns
Pointer to the explicit frame. Nullptr if the index does not exist.
See also
uint64_t FrameCount() const

◆ FrameByIndex() [2/2]

Frame* sdf::SDF_VERSION_NAMESPACE::World::FrameByIndex ( uint64_t  _index)

Get a mutable immediate (not nested) child explicit frame based on an index.

Parameters
[in]_indexIndex of the explicit frame. The index should be in the range [0..FrameCount()).
Returns
Pointer to the explicit frame. Nullptr if the index does not exist.
See also
uint64_t FrameCount() const

◆ FrameByName() [1/2]

Frame* sdf::SDF_VERSION_NAMESPACE::World::FrameByName ( const std::string &  _name)

Get a mutable explicit frame based on a name.

Parameters
[in]_nameName of the explicit frame. To get a frame in a nested model, prefix the frame name with the sequence of nested models containing this frame, delimited by "::".
Returns
Pointer to the explicit frame. Nullptr if the name does not exist.

◆ FrameByName() [2/2]

const Frame* sdf::SDF_VERSION_NAMESPACE::World::FrameByName ( const std::string &  _name) const

Get an explicit frame based on a name.

Parameters
[in]_nameName of the explicit frame. To get a frame in a nested model, prefix the frame name with the sequence of nested models containing this frame, delimited by "::".
Returns
Pointer to the explicit frame. Nullptr if the name does not exist.

◆ FrameCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::World::FrameCount ( ) const

Get the number of explicit frames that are immediate (not nested) children of this World object.

Remarks
FrameByName() can find explicit frames that are not immediate children of this World object.
Returns
Number of explicit frames contained in this World object.

◆ FrameNameExists()

bool sdf::SDF_VERSION_NAMESPACE::World::FrameNameExists ( const std::string &  _name) const

Get whether an explicit frame name exists.

Parameters
[in]_nameName of the explicit frame to check. To check for a frame in a nested model, prefix the frame name with the sequence of nested models containing this frame, delimited by "::".
Returns
True if there exists an explicit frame with the given name.

◆ Gravity()

gz::math::Vector3d sdf::SDF_VERSION_NAMESPACE::World::Gravity ( ) const

Get the acceleration due to gravity.

The default value is Earth's standard gravity at sea level, which equals [0, 0, -9.80665] \((\frac{m}{s^2})\)

Returns
Gravity vector in meters per second squared \((\frac{m}{s^2})\)

◆ Gui()

const sdf::Gui* sdf::SDF_VERSION_NAMESPACE::World::Gui ( ) const

Get a pointer to the Gui associated with this world.

A nullptr indicates that a Gui element has not been specified.

Returns
Pointer to this world's Gui parameters. Nullptr inidicates that there are no Gui parameters.

◆ InterfaceModelByIndex()

std::shared_ptr<const InterfaceModel> sdf::SDF_VERSION_NAMESPACE::World::InterfaceModelByIndex ( const uint64_t  _index) const

Get an immediate (not recursively nested) child interface model based on an index.

Parameters
[in]_indexIndex of the nested interface model. The index should be in the range [0..InterfaceModelCount()).
Returns
Pointer to the model. Nullptr if the index does not exist.
See also
uint64_t InterfaceModelCount() const

◆ InterfaceModelCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::World::InterfaceModelCount ( ) const

Get the number of nested interface models that are immediate (not recursively nested) children of this World object.

Returns
Number of nested interface models contained in this World object.

◆ InterfaceModelNestedIncludeByIndex()

const NestedInclude* sdf::SDF_VERSION_NAMESPACE::World::InterfaceModelNestedIncludeByIndex ( const uint64_t  _index) const

Get the nested include information of an immediate (not recursively nested) child interface model based on an index.

Parameters
[in]_indexIndex of the nested interface model. The index should be in the range [0..InterfaceModelCount()).
Returns
Pointer to the nested include information. Nullptr if the index does not exist.
See also
uint64_t InterfaceModelCount() const

◆ JointByIndex() [1/2]

Joint* sdf::SDF_VERSION_NAMESPACE::World::JointByIndex ( uint64_t  _index)

Get a mutable joint based on an index.

Parameters
[in]_indexIndex of the joint. The index should be in the range [0..JointCount()).
Returns
Pointer to the joint. Nullptr if the index does not exist.
See also
uint64_t JointCount() const

◆ JointByIndex() [2/2]

const Joint* sdf::SDF_VERSION_NAMESPACE::World::JointByIndex ( uint64_t  _index) const

Get a joint based on an index.

Parameters
[in]_indexIndex of the joint. The index should be in the range [0..JointCount()).
Returns
Pointer to the joint. Nullptr if the index does not exist.
See also
uint64_t JointCount() const

◆ JointByName() [1/2]

Joint* sdf::SDF_VERSION_NAMESPACE::World::JointByName ( const std::string &  _name)

Get a mutable joint based on a name.

Parameters
[in]_nameName of the joint. To get a joint in a nested model, prefix the joint name with the sequence of nested models containing this joint, delimited by "::".
Returns
Pointer to the joint. Nullptr if the name does not exist.

◆ JointByName() [2/2]

const Joint* sdf::SDF_VERSION_NAMESPACE::World::JointByName ( const std::string &  _name) const

Get an joint based on a name.

Parameters
[in]_nameName of the joint. To get a joint in a nested model, prefix the joint name with the sequence of nested models containing this joint, delimited by "::".
Returns
Pointer to the joint. Nullptr if the name does not exist.

◆ JointCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::World::JointCount ( ) const

Get the number of joints.

Returns
Number of joints contained in this World object.

◆ JointNameExists()

bool sdf::SDF_VERSION_NAMESPACE::World::JointNameExists ( const std::string &  _name) const

Get whether a joint name exists.

Parameters
[in]_nameName of the joint to check.
Returns
True if there exists a joint with the given name.

◆ LightByIndex() [1/2]

const Light* sdf::SDF_VERSION_NAMESPACE::World::LightByIndex ( const uint64_t  _index) const

Get a light based on an index.

Parameters
[in]_indexIndex of the light. The index should be in the range [0..LightCount()).
Returns
Pointer to the light. Nullptr if the index does not exist.
See also
uint64_t LightCount() const

◆ LightByIndex() [2/2]

Light* sdf::SDF_VERSION_NAMESPACE::World::LightByIndex ( uint64_t  _index)

Get a mutable light based on an index.

Parameters
[in]_indexIndex of the light. The index should be in the range [0..LightCount()).
Returns
Pointer to the light. Nullptr if the index does not exist.
See also
uint64_t LightCount() const

◆ LightCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::World::LightCount ( ) const

Get the number of lights.

Returns
Number of lights contained in this World object.

◆ LightNameExists()

bool sdf::SDF_VERSION_NAMESPACE::World::LightNameExists ( const std::string &  _name) const

Get whether a light name exists.

Parameters
[in]_nameName of the light to check.
Returns
True if there exists a light with the given name.

◆ Load() [1/2]

Errors sdf::SDF_VERSION_NAMESPACE::World::Load ( ElementPtr  _sdf)

Load the world based on a 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.

◆ Load() [2/2]

Errors sdf::SDF_VERSION_NAMESPACE::World::Load ( sdf::ElementPtr  _sdf,
const ParserConfig _config 
)

Load the world based on a 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
[in]_configCustom parser configuration
Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

◆ MagneticField()

gz::math::Vector3d sdf::SDF_VERSION_NAMESPACE::World::MagneticField ( ) const

Get the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinates property.

A spherical coordinate can be specified in SDF using the <spherical_coordinates> element.

Returns
Magnetic field vector.
See also
SphericalCoordinates

◆ ModelByIndex() [1/2]

const Model* sdf::SDF_VERSION_NAMESPACE::World::ModelByIndex ( const uint64_t  _index) const

Get an immediate (not recursively nested) child model based on an index.

Parameters
[in]_indexIndex of the model. The index should be in the range [0..ModelCount()).
Returns
Pointer to the model. Nullptr if the index does not exist.
See also
uint64_t ModelCount() const

◆ ModelByIndex() [2/2]

Model* sdf::SDF_VERSION_NAMESPACE::World::ModelByIndex ( uint64_t  _index)

Get an immediate (not recursively nested) mutable child model based on an index.

Parameters
[in]_indexIndex of the model. The index should be in the range [0..ModelCount()).
Returns
Pointer to the model. Nullptr if the index does not exist.
See also
uint64_t ModelCount() const

◆ ModelByName() [1/2]

Model* sdf::SDF_VERSION_NAMESPACE::World::ModelByName ( const std::string &  _name)

Get a mutable model based on a name.

Parameters
[in]_nameName of the model. To get a model nested in other models, prefix the model name with the sequence of nested model names, delimited by "::".
Returns
Pointer to the model. Nullptr if a model with the given name does not exist.
See also
bool ModelNameExists(const std::string &_name) const

◆ ModelByName() [2/2]

const Model* sdf::SDF_VERSION_NAMESPACE::World::ModelByName ( const std::string &  _name) const

Get a model based on a name.

Parameters
[in]_nameName of the model. To get a model nested in other models, prefix the model name with the sequence of nested model names, delimited by "::".
Returns
Pointer to the model. Nullptr if a model with the given name does not exist.
See also
bool ModelNameExists(const std::string &_name) const

◆ ModelCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::World::ModelCount ( ) const

Get the number of models that are immediate (not nested) children of this World object.

Remarks
ModelByName() can find nested models that are not immediate children of this World object.
Returns
Number of models contained in this World object.

◆ ModelNameExists()

bool sdf::SDF_VERSION_NAMESPACE::World::ModelNameExists ( const std::string &  _name) const

Get whether a model name exists.

Parameters
[in]_nameName of the model to check. To check for a model nested in other models, prefix the model name with the sequence of nested models containing this model, delimited by "::".
Returns
True if there exists a model with the given name.

◆ Name()

std::string sdf::SDF_VERSION_NAMESPACE::World::Name ( ) const

Get the name of the world.

Returns
Name of the world.

◆ NameExistsInFrameAttachedToGraph()

bool sdf::SDF_VERSION_NAMESPACE::World::NameExistsInFrameAttachedToGraph ( const std::string &  _name) const

Check if a given name exists in the FrameAttachedTo graph at the scope of the world.

Parameters
[in]_nameName of the implicit or explicit frame to check. To check for a frame in a nested model, prefix the frame name with the sequence of nested models containing this frame, delimited by "::".
Returns
True if the frame name is found in the FrameAttachedTo graph. False otherwise, or if the frame graph is invalid.
Note
This function assumes the world has a valid FrameAttachedTo graph. It will return false if the graph is invalid.

◆ PhysicsByIndex() [1/2]

const Physics* sdf::SDF_VERSION_NAMESPACE::World::PhysicsByIndex ( const uint64_t  _index) const

Get a physics profile based on an index.

Parameters
[in]_indexIndex of the physics profile. The index should be in the range [0..PhysicsCount()).
Returns
Pointer to the physics profile. Nullptr if the index does not exist.

◆ PhysicsByIndex() [2/2]

Physics* sdf::SDF_VERSION_NAMESPACE::World::PhysicsByIndex ( uint64_t  _index)

Get a mutable physics profile based on an index.

Parameters
[in]_indexIndex of the physics profile. The index should be in the range [0..PhysicsCount()).
Returns
Pointer to the physics profile. Nullptr if the index does not exist.

◆ PhysicsCount()

uint64_t sdf::SDF_VERSION_NAMESPACE::World::PhysicsCount ( ) const

Get the number of physics profiles.

Returns
Number of physics profiles contained in this World object.

◆ PhysicsDefault()

const Physics* sdf::SDF_VERSION_NAMESPACE::World::PhysicsDefault ( ) const

Get the default physics profile.

Returns
Pointer to the default physics profile.

◆ PhysicsNameExists()

bool sdf::SDF_VERSION_NAMESPACE::World::PhysicsNameExists ( const std::string &  _name) const

Get whether a physics profile name exists.

Parameters
[in]_nameName of the physics profile to check.
Returns
True if there exists a physics profile with the given name.

◆ Plugins() [1/2]

sdf::Plugins& sdf::SDF_VERSION_NAMESPACE::World::Plugins ( )

Get a mutable vector of plugins attached to this object.

Returns
A vector of Plugin, which will be empty if there are no plugins.

◆ Plugins() [2/2]

const sdf::Plugins& sdf::SDF_VERSION_NAMESPACE::World::Plugins ( ) const

Get the plugins attached to this object.

Returns
A vector of Plugin, which will be empty if there are no plugins.

◆ ResolveAutoInertials()

void sdf::SDF_VERSION_NAMESPACE::World::ResolveAutoInertials ( sdf::Errors _errors,
const ParserConfig _config 
)

Calculate and set the inertials for all the models in the world object.

Parameters
[out]_errrorsA vector of Errors objects. Each errors contains an Error code and a message. An empty errors vector indicates no errors
[in]_configCustom parser configuration

◆ Scene()

const sdf::Scene* sdf::SDF_VERSION_NAMESPACE::World::Scene ( ) const

Get a pointer to the Scene associated with this world.

A nullptr indicates that a Scene element has not been specified.

Returns
Pointer to this world's Scene parameters. Nullptr inidicates that there are no Scene parameters.

◆ SetAtmosphere()

void sdf::SDF_VERSION_NAMESPACE::World::SetAtmosphere ( const sdf::Atmosphere _atmosphere)

Set the atmosphere model associated with this world.

Parameters
[in]_atmosphereThe new atmosphere model for this world.

◆ SetAudioDevice()

void sdf::SDF_VERSION_NAMESPACE::World::SetAudioDevice ( const std::string &  _device)

Set the audio device name.

See std::string AudioDevice() const for more information.

Parameters
[in]_deviceThe new audio device name.
See also
std::string AudioDevice() const

◆ SetGravity()

void sdf::SDF_VERSION_NAMESPACE::World::SetGravity ( const gz::math::Vector3d &  _gravity)

Set the acceleration due to gravity.

Units are meters per second squared \((\frac{m}{s^2})\)

Parameters
[in]_gravityThe new gravity vector.

◆ SetGui()

void sdf::SDF_VERSION_NAMESPACE::World::SetGui ( const sdf::Gui _gui)

Set the Gui parameters associated with this world.

Parameters
[in]_guiThe new Gui parameter for this world

◆ SetMagneticField()

void sdf::SDF_VERSION_NAMESPACE::World::SetMagneticField ( const gz::math::Vector3d &  _mag)

Set the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinate.

A spherical coordinate can be specified in SDF using the <spherical_coordinates> element.

Parameters
[in]_magThe new magnetic field vector.
See also
SphericalCoordinates

◆ SetName()

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

Set the name of the world.

Parameters
[in]_nameName of the world.

◆ SetScene()

void sdf::SDF_VERSION_NAMESPACE::World::SetScene ( const sdf::Scene _scene)

Set the Scene parameters associated with this world.

Parameters
[in]_guiThe new Scene parameter for this world

◆ SetSphericalCoordinates()

void sdf::SDF_VERSION_NAMESPACE::World::SetSphericalCoordinates ( const gz::math::SphericalCoordinates &  _coord)

Set the spherical coordinates for the world origin.

Parameters
[in]_coordThe new coordinates for the world origin.

◆ SetWindLinearVelocity()

void sdf::SDF_VERSION_NAMESPACE::World::SetWindLinearVelocity ( const gz::math::Vector3d &  _wind)

Set the wind linear velocity in the global/world coordinate frame.

Units are meters per second \((\frac{m}{s})\)

Parameters
[in]_windThe new linear velocity of wind.
See also
gz::math::Vector3d WindLinearVelocity() const

◆ SphericalCoordinates()

const gz::math::SphericalCoordinates* sdf::SDF_VERSION_NAMESPACE::World::SphericalCoordinates ( ) const

Get the spherical coordinates for the world origin.

Returns
Spherical coordinates or null if not defined.

◆ ToElement()

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::World::ToElement ( const OutputConfig _config = OutputConfig::GlobalConfig()) const

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

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

Parameters
[in]_configCustom parser configuration
Returns
SDF element pointer with updated world values.

◆ ValidateGraphs()

Errors sdf::SDF_VERSION_NAMESPACE::World::ValidateGraphs ( ) const

Check that the FrameAttachedToGraph and PoseRelativeToGraph are valid.

Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

◆ WindLinearVelocity()

gz::math::Vector3d sdf::SDF_VERSION_NAMESPACE::World::WindLinearVelocity ( ) const

Get the wind linear velocity in the global/world coordinate frame.

Units are meters per second \((\frac{m}{s})\)

Returns
Linear velocity of wind in the global/world coordinate frame.
See also
void SetWindLinearVelocity(const gz::math::Vector3d &_wind)

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