how to determine if an object already is in "gClientSceneGraph"
by Stefan Beffy Moises · in Torque Game Engine · 07/30/2002 (10:57 am) · 3 replies
Hi there!
Is there a way to determine if an object was already added to the scenegraph before adding it with
SceneGraph::zoneInsert(SceneObject* obj) is called for my ShapeBase object, and this function *seems* to check that anyways... but I'm not 100 percent sure about that...
any insights?
Thanks! :)
Is there a way to determine if an object was already added to the scenegraph before adding it with
gClientSceneGraph->addObjectToScene(shape);Or should I just not care at all, cause in the end,
SceneGraph::zoneInsert(SceneObject* obj) is called for my ShapeBase object, and this function *seems* to check that anyways... but I'm not 100 percent sure about that...
any insights?
Thanks! :)
About the author
Associate Melv May
All SceneObjects maintain a reference to their scene manager called 'mSceneManager'. If this is NULL then it's not in one else it will point to the appropriate one.
The only problem you may have with this is that it's protected so you'll need to inherit unfortunately. Of course you could add a function in SceneObject to check for NULL against this member for you, ;)
Hope this helps,
- Melv