Base class for wind.
More...
#include <physics/physics.hh>
|
| 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...
|
|
◆ Wind()
Wind |
( |
World & |
_world, |
|
|
sdf::ElementPtr |
_sdf |
|
) |
| |
|
explicit |
Default constructor.
- Parameters
-
[in] | _world | Reference to the world. |
[in] | _sdf | SDF element parameters for the wind. |
◆ ~Wind()
◆ LinearVel()
const ignition::math::Vector3d& LinearVel |
( |
void |
| ) |
const |
Get the global wind velocity.
- Returns
- Linear velocity of the wind.
◆ Load()
virtual void Load |
( |
sdf::ElementPtr |
_sdf | ) |
|
|
virtual |
Load the wind.
- Parameters
-
[in] | _sdf | Pointer to the SDF parameters. |
◆ Param() [1/2]
boost::any Param |
( |
const std::string & |
_key | ) |
const |
Get a wind parameter.
- Parameters
-
- See also
- SetParam
- Returns
- The value of the parameter
◆ Param() [2/2]
bool Param |
( |
const std::string & |
_key, |
|
|
boost::any & |
_value |
|
) |
| const |
Get a wind parameter with a boolean to indicate success or failure.
- Parameters
-
[in] | _key | Key of the accessed param |
[out] | _value | Value of the accessed param |
- Returns
- True if the parameter was successfully retrieved
◆ RelativeLinearVel()
ignition::math::Vector3d RelativeLinearVel |
( |
const Entity * |
_entity | ) |
const |
Get the wind velocity at an entity location.
- Parameters
-
[in] | _entity | Entity at which location the wind is applied. |
- Returns
- Linear velocity of the wind.
◆ SetLinearVel()
void SetLinearVel |
( |
const ignition::math::Vector3d & |
_vel | ) |
|
Set the global wind velocity.
- Parameters
-
[in] | _vel | Global wind velocity. |
◆ SetLinearVelFunc()
void SetLinearVelFunc |
( |
std::function< ignition::math::Vector3d(const Wind *_wind, const Entity *_entity) > |
_linearVelFunc | ) |
|
Setup function to compute the wind.
- Parameters
-
[in] | _linearVelFunc | The 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. |
◆ SetParam()
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] | _key | String key Below is a list of _key parameter definitions:
- "linear_vel" (Vector3d) - wind linear velocity
|
[in] | _value | The value to set to |
- Returns
- true if SetParam is successful, false if operation fails.
◆ WorldLinearVel()
ignition::math::Vector3d WorldLinearVel |
( |
const Entity * |
_entity | ) |
const |
Get the wind velocity at an entity location in the world coordinate frame.
- Parameters
-
[in] | _entity | Entity at which location the wind is applied. |
- Returns
- Linear velocity of the wind.
The documentation for this class was generated from the following file: