Wind Class Reference

Base class for wind. More...

#include <physics/physics.hh>

Public Member Functions

 Wind (World &_world, sdf::ElementPtr _sdf)
 Default constructor. More...
 
virtual ~Wind ()
 Destructor. More...
 
const ignition::math::Vector3d & LinearVel (void) const
 Get the global wind velocity. More...
 
virtual void Load (sdf::ElementPtr _sdf)
 Load the wind. More...
 
boost::any Param (const std::string &_key) const
 Get a wind parameter. More...
 
bool Param (const std::string &_key, boost::any &_value) const
 Get a wind parameter with a boolean to indicate success or failure. More...
 
ignition::math::Vector3d RelativeLinearVel (const Entity *_entity) const
 Get the wind velocity at an entity location. More...
 
void SetLinearVel (const ignition::math::Vector3d &_vel)
 Set the global wind velocity. More...
 
void SetLinearVelFunc (std::function< ignition::math::Vector3d(const Wind *_wind, const Entity *_entity) > _linearVelFunc)
 Setup function to compute the wind. More...
 
bool SetParam (const std::string &_key, const boost::any &_value)
 Set a parameter of the wind. More...
 
ignition::math::Vector3d WorldLinearVel (const Entity *_entity) const
 Get the wind velocity at an entity location in the world coordinate frame. More...
 

Detailed Description

Base class for wind.

Constructor & Destructor Documentation

Wind ( World _world,
sdf::ElementPtr  _sdf 
)
explicit

Default constructor.

Parameters
[in]_worldReference to the world.
[in]_sdfSDF element parameters for the wind.
virtual ~Wind ( )
virtual

Destructor.

Member Function Documentation

const ignition::math::Vector3d& LinearVel ( void  ) const

Get the global wind velocity.

Returns
Linear velocity of the wind.
virtual void Load ( sdf::ElementPtr  _sdf)
virtual

Load the wind.

Parameters
[in]_sdfPointer to the SDF parameters.
boost::any Param ( const std::string &  _key) const

Get a wind parameter.

Parameters
[in]_attrString key
See also
SetParam
Returns
The value of the parameter
bool Param ( const std::string &  _key,
boost::any &  _value 
) const

Get a wind parameter with a boolean to indicate success or failure.

Parameters
[in]_keyKey of the accessed param
[out]_valueValue of the accessed param
Returns
True if the parameter was successfully retrieved
ignition::math::Vector3d RelativeLinearVel ( const Entity _entity) const

Get the wind velocity at an entity location.

Parameters
[in]_entityEntity at which location the wind is applied.
Returns
Linear velocity of the wind.
void SetLinearVel ( const ignition::math::Vector3d &  _vel)

Set the global wind velocity.

Parameters
[in]_velGlobal wind velocity.
void SetLinearVelFunc ( std::function< ignition::math::Vector3d(const Wind *_wind, const Entity *_entity) >  _linearVelFunc)

Setup function to compute the wind.

Parameters
[in]_linearVelFuncThe function callback that is used to calculate the wind's velocity. The parameters to the function callback is a reference to an instance of Wind and a pointer to an entity in the scene. The function must return the new wind velocity as a vector.
bool SetParam ( const std::string &  _key,
const boost::any &  _value 
)

Set a parameter of the wind.

See SetParam documentation for descriptions of duplicate parameters.

Parameters
[in]_keyString key Below is a list of _key parameter definitions:
  1. "linear_vel" (Vector3d) - wind linear velocity
[in]_valueThe value to set to
Returns
true if SetParam is successful, false if operation fails.
ignition::math::Vector3d WorldLinearVel ( const Entity _entity) const

Get the wind velocity at an entity location in the world coordinate frame.

Parameters
[in]_entityEntity at which location the wind is applied.
Returns
Linear velocity of the wind.

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