Rendering a terrain using heightmap information. More...
#include <rendering/rendering.hh>
Public Member Functions | |
Heightmap (ScenePtr _scene) | |
Constructor. More... | |
virtual | ~Heightmap () |
Destructor. More... | |
double | AvgHeight (const ignition::math::Vector3d &_pos, const double _brushSize) const |
Get the average height around a point. More... | |
bool | Flatten (CameraPtr _camera, math::Vector2i _mousePos, double _outsideRadius, double _insideRadius, double _weight=0.1) GAZEBO_DEPRECATED(7.0) |
Flatten the terrain based on a mouse press. More... | |
bool | Flatten (CameraPtr _camera, const ignition::math::Vector2i &_mousePos, const double _outsideRadius, const double _insideRadius, const double _weight=0.1) |
Flatten the terrain based on a mouse press. More... | |
double | GetAvgHeight (Ogre::Vector3 _pos, double _brushSize) GAZEBO_DEPRECATED(7.0) |
Get the average height around a point. More... | |
double | GetHeight (double _x, double _y, double _z=1000) GAZEBO_DEPRECATED(7.0) |
Get the height at a location. More... | |
common::Image | GetImage () const GAZEBO_DEPRECATED(7.0) |
Get the heightmap as an image. More... | |
Ogre::TerrainGroup::RayResult | GetMouseHit (CameraPtr _camera, math::Vector2i _mousePos) GAZEBO_DEPRECATED(7.0) |
Calculate a mouse ray hit on the terrain. More... | |
Ogre::TerrainGroup * | GetOgreTerrain () const GAZEBO_DEPRECATED(7.0) |
Get a pointer to the OGRE terrain group object. More... | |
unsigned int | GetTerrainSubdivisionCount () const GAZEBO_DEPRECATED(7.0) |
Get the number of subdivision the terrain will be split into. More... | |
double | Height (const double _x, const double _y, const double _z=1000) const |
Get the height at a location. More... | |
common::Image | Image () const |
Get the heightmap as an image. More... | |
void | Load () |
Load the heightmap. More... | |
void | LoadFromMsg (ConstVisualPtr &_msg) |
Load the heightmap from a visual message. More... | |
bool | Lower (CameraPtr _camera, math::Vector2i _mousePos, double _outsideRadius, double _insideRadius, double _weight=0.1) GAZEBO_DEPRECATED(7.0) |
Lower the terrain based on a mouse press. More... | |
bool | Lower (CameraPtr _camera, const ignition::math::Vector2i &_mousePos, const double _outsideRadius, const double _insideRadius, const double _weight=0.1) |
Lower the terrain based on a mouse press. More... | |
Ogre::TerrainGroup::RayResult | MouseHit (CameraPtr _camera, const ignition::math::Vector2i &_mousePos) const |
Calculate a mouse ray hit on the terrain. More... | |
Ogre::TerrainGroup * | OgreTerrain () const |
Get a pointer to the OGRE terrain group object. More... | |
bool | Raise (CameraPtr _camera, math::Vector2i _mousePos, double _outsideRadius, double _insideRadius, double _weight=0.1) GAZEBO_DEPRECATED(7.0) |
Raise the terrain based on a mouse press. More... | |
bool | Raise (CameraPtr _camera, const ignition::math::Vector2i &_mousePos, const double _outsideRadius, const double _insideRadius, const double _weight=0.1) |
Raise the terrain based on a mouse press. More... | |
void | SetWireframe (const bool _show) |
Set the heightmap to render in wireframe mode. More... | |
bool | Smooth (CameraPtr _camera, math::Vector2i _mousePos, double _outsideRadius, double _insideRadius, double _weight=0.1) GAZEBO_DEPRECATED(7.0) |
Smooth the terrain based on a mouse press. More... | |
bool | Smooth (CameraPtr _camera, const ignition::math::Vector2i &_mousePos, const double _outsideRadius, const double _insideRadius, const double _weight=0.1) |
Smooth the terrain based on a mouse press. More... | |
void | SplitHeights (const std::vector< float > &_heightmap, const int _n, std::vector< std::vector< float > > &_v) |
Split a terrain into subterrains. More... | |
unsigned int | TerrainSubdivisionCount () const |
Get the number of subdivision the terrain will be split into. More... | |
Rendering a terrain using heightmap information.
gazebo::rendering::Heightmap::Heightmap | ( | ScenePtr | _scene | ) |
Constructor.
[in] | _scene | Pointer to the scene that will contain the heightmap |
|
virtual |
Destructor.
double gazebo::rendering::Heightmap::AvgHeight | ( | const ignition::math::Vector3d & | _pos, |
const double | _brushSize | ||
) | const |
Get the average height around a point.
[in] | _pos | Position in world coordinates. |
[in] | _brushSize | Controls the radius of effect. |
bool gazebo::rendering::Heightmap::Flatten | ( | CameraPtr | _camera, |
math::Vector2i | _mousePos, | ||
double | _outsideRadius, | ||
double | _insideRadius, | ||
double | _weight = 0.1 |
||
) |
Flatten the terrain based on a mouse press.
[in] | _camera | Camera associated with the mouse press. |
[in] | _mousePos | Position of the mouse in viewport coordinates. |
[in] | _outsideRadius | Controls the radius of effect. |
[in] | _insideRadius | Controls the size of the radius with the maximum effect (value between 0 and 1). |
[in] | _weight | Controls modification magnitude. |
bool gazebo::rendering::Heightmap::Flatten | ( | CameraPtr | _camera, |
const ignition::math::Vector2i & | _mousePos, | ||
const double | _outsideRadius, | ||
const double | _insideRadius, | ||
const double | _weight = 0.1 |
||
) |
Flatten the terrain based on a mouse press.
[in] | _camera | Camera associated with the mouse press. |
[in] | _mousePos | Position of the mouse in viewport coordinates. |
[in] | _outsideRadius | Controls the radius of effect. |
[in] | _insideRadius | Controls the size of the radius with the maximum effect (value between 0 and 1). |
[in] | _weight | Controls modification magnitude. |
double gazebo::rendering::Heightmap::GetAvgHeight | ( | Ogre::Vector3 | _pos, |
double | _brushSize | ||
) |
Get the average height around a point.
[in] | _pos | Position in world coordinates. |
[in] | _brushSize | Controls the radius of effect. |
double gazebo::rendering::Heightmap::GetHeight | ( | double | _x, |
double | _y, | ||
double | _z = 1000 |
||
) |
Get the height at a location.
[in] | _x | X location |
[in] | _y | Y location |
[in] | _z | Z location |
common::Image gazebo::rendering::Heightmap::GetImage | ( | ) | const |
Get the heightmap as an image.
Ogre::TerrainGroup::RayResult gazebo::rendering::Heightmap::GetMouseHit | ( | CameraPtr | _camera, |
math::Vector2i | _mousePos | ||
) |
Calculate a mouse ray hit on the terrain.
[in] | _camera | Camera associated with the mouse press. |
[in] | _mousePos | Position of the mouse in viewport coordinates. |
Ogre::TerrainGroup* gazebo::rendering::Heightmap::GetOgreTerrain | ( | ) | const |
Get a pointer to the OGRE terrain group object.
unsigned int gazebo::rendering::Heightmap::GetTerrainSubdivisionCount | ( | ) | const |
Get the number of subdivision the terrain will be split into.
double gazebo::rendering::Heightmap::Height | ( | const double | _x, |
const double | _y, | ||
const double | _z = 1000 |
||
) | const |
Get the height at a location.
[in] | _x | X location |
[in] | _y | Y location |
[in] | _z | Z location |
common::Image gazebo::rendering::Heightmap::Image | ( | ) | const |
Get the heightmap as an image.
void gazebo::rendering::Heightmap::Load | ( | ) |
Load the heightmap.
void gazebo::rendering::Heightmap::LoadFromMsg | ( | ConstVisualPtr & | _msg | ) |
Load the heightmap from a visual message.
[in] | _msg | The visual message containing heightmap info |
bool gazebo::rendering::Heightmap::Lower | ( | CameraPtr | _camera, |
math::Vector2i | _mousePos, | ||
double | _outsideRadius, | ||
double | _insideRadius, | ||
double | _weight = 0.1 |
||
) |
Lower the terrain based on a mouse press.
[in] | _camera | Camera associated with the mouse press. |
[in] | _mousePos | Position of the mouse in viewport coordinates. |
[in] | _outsideRadius | Controls the radius of effect. |
[in] | _insideRadius | Controls the size of the radius with the maximum effect (value between 0 and 1). |
[in] | _weight | Controls modification magnitude. |
bool gazebo::rendering::Heightmap::Lower | ( | CameraPtr | _camera, |
const ignition::math::Vector2i & | _mousePos, | ||
const double | _outsideRadius, | ||
const double | _insideRadius, | ||
const double | _weight = 0.1 |
||
) |
Lower the terrain based on a mouse press.
[in] | _camera | Camera associated with the mouse press. |
[in] | _mousePos | Position of the mouse in viewport coordinates. |
[in] | _outsideRadius | Controls the radius of effect. |
[in] | _insideRadius | Controls the size of the radius with the maximum effect (value between 0 and 1). |
[in] | _weight | Controls modification magnitude. |
Ogre::TerrainGroup::RayResult gazebo::rendering::Heightmap::MouseHit | ( | CameraPtr | _camera, |
const ignition::math::Vector2i & | _mousePos | ||
) | const |
Calculate a mouse ray hit on the terrain.
[in] | _camera | Camera associated with the mouse press. |
[in] | _mousePos | Position of the mouse in viewport coordinates. |
Ogre::TerrainGroup* gazebo::rendering::Heightmap::OgreTerrain | ( | ) | const |
Get a pointer to the OGRE terrain group object.
bool gazebo::rendering::Heightmap::Raise | ( | CameraPtr | _camera, |
math::Vector2i | _mousePos, | ||
double | _outsideRadius, | ||
double | _insideRadius, | ||
double | _weight = 0.1 |
||
) |
Raise the terrain based on a mouse press.
[in] | _camera | Camera associated with the mouse press. |
[in] | _mousePos | Position of the mouse in viewport coordinates. |
[in] | _outsideRadius | Controls the radius of effect. |
[in] | _insideRadius | Controls the size of the radius with the maximum effect (value between 0 and 1). |
[in] | _weight | Controls modification magnitude. |
bool gazebo::rendering::Heightmap::Raise | ( | CameraPtr | _camera, |
const ignition::math::Vector2i & | _mousePos, | ||
const double | _outsideRadius, | ||
const double | _insideRadius, | ||
const double | _weight = 0.1 |
||
) |
Raise the terrain based on a mouse press.
[in] | _camera | Camera associated with the mouse press. |
[in] | _mousePos | Position of the mouse in viewport coordinates. |
[in] | _outsideRadius | Controls the radius of effect. |
[in] | _insideRadius | Controls the size of the radius with the maximum effect (value between 0 and 1). |
[in] | _weight | Controls modification magnitude. |
void gazebo::rendering::Heightmap::SetWireframe | ( | const bool | _show | ) |
Set the heightmap to render in wireframe mode.
[in] | _show | True to render wireframe, false to render solid. |
bool gazebo::rendering::Heightmap::Smooth | ( | CameraPtr | _camera, |
math::Vector2i | _mousePos, | ||
double | _outsideRadius, | ||
double | _insideRadius, | ||
double | _weight = 0.1 |
||
) |
Smooth the terrain based on a mouse press.
[in] | _camera | Camera associated with the mouse press. |
[in] | _mousePos | Position of the mouse in viewport coordinates. |
[in] | _outsideRadius | Controls the radius of effect. |
[in] | _insideRadius | Controls the size of the radius with the maximum effect (value between 0 and 1). |
[in] | _weight | Controls modification magnitude. |
bool gazebo::rendering::Heightmap::Smooth | ( | CameraPtr | _camera, |
const ignition::math::Vector2i & | _mousePos, | ||
const double | _outsideRadius, | ||
const double | _insideRadius, | ||
const double | _weight = 0.1 |
||
) |
Smooth the terrain based on a mouse press.
[in] | _camera | Camera associated with the mouse press. |
[in] | _mousePos | Position of the mouse in viewport coordinates. |
[in] | _outsideRadius | Controls the radius of effect. |
[in] | _insideRadius | Controls the size of the radius with the maximum effect (value between 0 and 1). |
[in] | _weight | Controls modification magnitude. |
void gazebo::rendering::Heightmap::SplitHeights | ( | const std::vector< float > & | _heightmap, |
const int | _n, | ||
std::vector< std::vector< float > > & | _v | ||
) |
Split a terrain into subterrains.
[in] | _heightmap | Source vector of floats with the heights. |
[in] | _n | Number of subterrains. |
[out] | _v | Destination vector with the subterrains. |
unsigned int gazebo::rendering::Heightmap::TerrainSubdivisionCount | ( | ) | const |
Get the number of subdivision the terrain will be split into.