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 <OgreSelectionBuffer.hh>
Public Member Functions | |
OgreSelectionBuffer (const std::string &_cameraName, Ogre::SceneManager *_mgr) | |
Constructor. | |
~OgreSelectionBuffer () | |
Destructor. | |
Ogre::Entity * | OnSelectionClick (const int _x, const int _y) |
Handle on mouse click. | |
void | ShowOverlay (const bool _show) |
Debug show overlay. | |
void | Update () |
Call this to update the selection buffer contents. | |
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
◆ OgreSelectionBuffer()
OgreSelectionBuffer | ( | const std::string & | _cameraName, |
Ogre::SceneManager * | _mgr | ||
) |
Constructor.
- Parameters
-
[in] _cameraName Name of the camera to generate a selection buffer for. [in] _mgr Pointer to the scene manager.
◆ ~OgreSelectionBuffer()
~OgreSelectionBuffer | ( | ) |
Destructor.
Member Function Documentation
◆ OnSelectionClick()
Ogre::Entity * OnSelectionClick | ( | const int | _x, |
const int | _y | ||
) |
Handle on mouse click.
- Parameters
-
[in] _x X coordinate in pixels. [in] _y Y coordinate in pixels.
- Returns
- Returns the Ogre entity at the coordinate.
◆ ShowOverlay()
void ShowOverlay | ( | const bool | _show | ) |
Debug show overlay.
- Parameters
-
[in] _show True to show the selection buffer in an overlay.
◆ Update()
void Update | ( | ) |
Call this to update the selection buffer contents.
The documentation for this class was generated from the following file: