void OgreNewtonDebugger::SetDebugMode(bool onOff) { if (onOff) { ShowDebugInformation(); } else { HideDebugInformation(); } }
void newtonDebugger::SetMode(bool onOff) { m_mode = onOff; if (onOff) { ShowDebugInformation(); } else { HideDebugInformation(); } }
void newtonDebugger::ShowDebugInformation() { HideDebugInformation(); dAssert (m_viewer->getSceneData()); Group* const rootNode = m_viewer->getSceneData()->asGroup(); m_debugRoot = new Group(); m_debugRoot->setUpdateCallback(new UpdateCallback()); rootNode->addChild(m_debugRoot.get()); for (dNewtonBody* body = m_world->GetFirstBody(); body; body = m_world->GetNextBody(body)) { ref_ptr<DebugTransformNode> transformNode = new DebugTransformNode(body); m_debugRoot->addChild(transformNode.get()); } }
OgreNewtonDebugger::~OgreNewtonDebugger() { HideDebugInformation(); m_debugNode->removeAndDestroyAllChildren(); m_debugNode->getParentSceneNode()->removeAndDestroyChild (m_debugNode->getName()); }