Rendering a terrain using heightmap information.
More...
#include <rendering/rendering.hh>
Public Member Functions |
| Heightmap (ScenePtr _scene) |
| Constructor.
|
virtual | ~Heightmap () |
| Destructor.
|
bool | Flatten (CameraPtr _camera, math::Vector2i _mousePos, double _outsideRadius, double _insideRadius, double _weight=0.1) |
| Flatten the terrain based on a mouse press.
|
double | GetAvgHeight (Ogre::Vector3 _pos, double _brushSize) |
| Get the average height around a point.
|
double | GetHeight (double _x, double _y, double _z=1000) |
| Get the height at a location.
|
common::Image | GetImage () const |
| Get the heightmap as an image.
|
Ogre::TerrainGroup::RayResult | GetMouseHit (CameraPtr _camera, math::Vector2i _mousePos) |
| Calculate a mouse ray hit on the terrain.
|
Ogre::TerrainGroup * | GetOgreTerrain () const |
| Get a pointer to the OGRE terrain group object.
|
void | Load () |
| Load the heightmap.
|
void | LoadFromMsg (ConstVisualPtr &_msg) |
| Load the heightmap from a visual message.
|
bool | Lower (CameraPtr _camera, math::Vector2i _mousePos, double _outsideRadius, double _insideRadius, double _weight=0.1) |
| Lower the terrain based on a mouse press.
|
bool | Raise (CameraPtr _camera, math::Vector2i _mousePos, double _outsideRadius, double _insideRadius, double _weight=0.1) |
| Raise the terrain based on a mouse press.
|
void | SetWireframe (bool _show) |
| Set the heightmap to render in wireframe mode.
|
bool | Smooth (CameraPtr _camera, math::Vector2i _mousePos, double _outsideRadius, double _insideRadius, double _weight=0.1) |
| Smooth the terrain based on a mouse press.
|
Detailed Description
Rendering a terrain using heightmap information.
Constructor & Destructor Documentation
gazebo::rendering::Heightmap::Heightmap |
( |
ScenePtr |
_scene | ) |
|
Constructor.
- Parameters
-
[in] | _scene | Pointer to the scene that will contain the heightmap |
virtual gazebo::rendering::Heightmap::~Heightmap |
( |
| ) |
|
|
virtual |
Member Function Documentation
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.
- Parameters
-
[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. |
- Returns
- True if the terrain was modified
double gazebo::rendering::Heightmap::GetAvgHeight |
( |
Ogre::Vector3 |
_pos, |
|
|
double |
_brushSize |
|
) |
| |
Get the average height around a point.
- Parameters
-
[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.
- Parameters
-
[in] | _x | X location |
[in] | _y | Y location |
[in] | _z | Z location |
- Returns
- The height at the specified location
Get the heightmap as an image.
- Returns
- An image that contains the terrain data.
Ogre::TerrainGroup::RayResult gazebo::rendering::Heightmap::GetMouseHit |
( |
CameraPtr |
_camera, |
|
|
math::Vector2i |
_mousePos |
|
) |
| |
Calculate a mouse ray hit on the terrain.
- Parameters
-
[in] | _camera | Camera associated with the mouse press. |
[in] | _mousePos | Position of the mouse in viewport coordinates. |
- Returns
- The result of the mouse ray hit.
Ogre::TerrainGroup* gazebo::rendering::Heightmap::GetOgreTerrain |
( |
| ) |
const |
Get a pointer to the OGRE terrain group object.
- Returns
- Pointer to the OGRE terrain.
void gazebo::rendering::Heightmap::Load |
( |
| ) |
|
void gazebo::rendering::Heightmap::LoadFromMsg |
( |
ConstVisualPtr & |
_msg | ) |
|
Load the heightmap from a visual message.
- Parameters
-
[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.
- Parameters
-
[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. |
- Returns
- True if the terrain was modified
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.
- Parameters
-
[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. |
- Returns
- True if the terrain was modified
void gazebo::rendering::Heightmap::SetWireframe |
( |
bool |
_show | ) |
|
Set the heightmap to render in wireframe mode.
- Parameters
-
[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.
- Parameters
-
[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. |
- Returns
- True if the terrain was modified
The documentation for this class was generated from the following file: