Gazebo Rendering

API Reference

3.7.2
Ogre2SelectionBuffer Class Reference

Generates a selection buffer object for a given camera. The selection buffer is used of entity selection. On setup, a unique color is assigned to each entity. Whenever a selection request is made, the selection buffer camera renders to a 1x1 sized offscreen buffer. The color value of that pixel gives the identity of the entity. More...

#include <Ogre2SelectionBuffer.hh>

Public Member Functions

 Ogre2SelectionBuffer (const std::string &_cameraName, Ogre2ScenePtr _scene)
 Constructor. More...
 
 ~Ogre2SelectionBuffer ()
 Destructor. More...
 
Ogre::Item * OnSelectionClick (const int _x, const int _y)
 Handle on mouse click. More...
 
void Update ()
 Call this to update the selection buffer contents. More...
 

Detailed Description

Generates a selection buffer object for a given camera. The selection buffer is used of entity selection. On setup, a unique color is assigned to each entity. Whenever a selection request is made, the selection buffer camera renders to a 1x1 sized offscreen buffer. The color value of that pixel gives the identity of the entity.

Constructor & Destructor Documentation

◆ Ogre2SelectionBuffer()

Ogre2SelectionBuffer ( const std::string _cameraName,
Ogre2ScenePtr  _scene 
)

Constructor.

Parameters
[in]_cameraNameName of the camera to generate a selection buffer for.
[in]_scenePointer to the scene

◆ ~Ogre2SelectionBuffer()

Destructor.

Member Function Documentation

◆ OnSelectionClick()

Ogre::Item* OnSelectionClick ( const int  _x,
const int  _y 
)

Handle on mouse click.

Parameters
[in]_xX coordinate in pixels.
[in]_yY coordinate in pixels.
Returns
Returns the Ogre item at the coordinate.

◆ Update()

void Update ( )

Call this to update the selection buffer contents.


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