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

#include <World.hh>

Public Member Functions

 World ()
 Default constructor. More...
 
 World (World &&_world)
 Move constructor. More...
 
 ~World ()
 Destructor. More...
 
std::string AudioDevice () const
 Get the audio device name. More...
 
ignition::math::Vector3d Gravity () const
 Get the acceleration due to gravity. More...
 
Errors Load (ElementPtr _sdf)
 Load the world based on a element pointer. More...
 
ignition::math::Vector3d MagneticField () const
 Get the magnetic vector in Tesla, expressed in a coordinate frame defined by the SphericalCoordinates property. More...
 
std::string Name () const
 Get the name of the world. More...
 
void SetAudioDevice (const std::string &_device)
 Set the audio device name. More...
 
void SetGravity (const ignition::math::Vector3d &_gravity)
 Set the acceleration due to gravity. More...
 
void SetMagneticField (const ignition::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) const
 Set the name of the world. More...
 
void SetWindLinearVelocity (const ignition::math::Vector3d &_wind)
 Set the wind linear velocity in the global/world coordinate frame. More...
 
ignition::math::Vector3d WindLinearVelocity () const
 Get the wind linear velocity in the global/world coordinate frame. More...
 

Constructor & Destructor Documentation

◆ World() [1/2]

sdf::World::World ( )

Default constructor.

◆ World() [2/2]

sdf::World::World ( World &&  _world)

Move constructor.

Parameters
[in]_worldWorld to move.

◆ ~World()

sdf::World::~World ( )

Destructor.

Member Function Documentation

◆ AudioDevice()

std::string sdf::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.

◆ Gravity()

ignition::math::Vector3d sdf::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})\)

◆ Load()

Errors sdf::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.

◆ MagneticField()

ignition::math::Vector3d sdf::World::MagneticField ( ) const

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

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

Returns
Magnetic field vector.
See also
SphericalCoordinates

◆ Name()

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

Get the name of the world.

Returns
Name of the world.

◆ SetAudioDevice()

void sdf::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::World::SetGravity ( const ignition::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.

◆ SetMagneticField()

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

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

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

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

◆ SetName()

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

Set the name of the world.

Parameters
[in]_nameName of the world.

◆ SetWindLinearVelocity()

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

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

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

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

◆ WindLinearVelocity()

ignition::math::Vector3d sdf::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 ignition::math::Vector3d &_wind)

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