Using OGRE entities within 3d Scene as CEGUI Buttons

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
Turtle
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Tue Nov 08, 2005 22:36

Using OGRE entities within 3d Scene as CEGUI Buttons

Postby Turtle » Wed May 24, 2006 23:23

Hi Guys,

Has anyone looked at using Ogre entities (meshes and the like) as clickable buttons within the 3d scene? Am I making sense? I don't mean using RenderToTexture to create a texture of an entity and use this on a button.

What I mean is doing something like:
(1) create your own class that inherits CEGUI::PushButton and overwrite the rendering code so that it doesn't actually draw anything
(2) setup code on the Ogre side of the application so that the location of an entity feeds back to CEGUI so that the position and size of the new PushButton mirrors the location and size of the Entity translated back into 2d screen coordinates.
(3) when you click on an object in the scene, CEGUI sees that you're actually clicking on one of it's buttons that just isn't drawn.

Or perhaps:
(1) as for step one above
(2) setup code on the Ogre side so that it does 3d object picking to know when the mouse is over an entity in the scene.
(3) when you click on an object, Ogre feeds back the information to CEGUI.

At the moment, in my app I have a fair number of CEGUI buttons, windows, etc, but my 3d scene also has a lot of objects that can be clicked on or interacted with. I currently have a set of ugly code on the Ogre side of things to handle interaction with the 3d scene and it would be nice to bring this all together a bit.

Btw, I'm not asking anyone to do this for me, I'm just asking if anyone has already done something like this! :)

Maybe I should just have my current code inherit CEGUI::EventSet as a compromise.

Cheers.

Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 13 guests