Gizmos, Manual Objects =D

s0lidnuts

04-08-2008 02:42:10

Yeah I want to create Gizmos (like Maya, 3dsMax, etc..) and intend to create them in run time. I can create it with Ogre::ManualObject and attach it like this:

body = m_PhysScene->createBody("Gizmo;", new NxOgre::Cube(10, 10, 100), Ogre::Vector3(50, 50, 50), "kinematic: yes");

node = m_SceneMgr->getSceneNode("Gizmo");
node->attachObject(circle);

with circle being the manual object. But.. is there another way to do it ? Without those getSceneNodes.. a more elegant way =) ?
@also, not to create another thread: is it possible to get the body through the actor ? Something like actor->getBody();

Thanks.

betajaen

04-08-2008 09:07:24

1. If you know that the Body is using a OgreNodeRenderable then you can cast the Renderable into one and use that class to operate on the node.

2. No; As there can be many times when the Actor in question isn't a Body. You can "check" to see if it is an Body via the hash functions - then static_cast but there can never be a "getBody()" function

s0lidnuts

04-08-2008 18:45:13

I have a Cube for each of the Gizmo's axis representation, how can I group them all in one Node ? If not possible, the only solution would be to move each of them at a time right ?

Thanks.

s0lidnuts

07-08-2008 01:34:17

*bump*
hello ? xD