Gf11speed
22-06-2008 03:25:05
I'm having a problem in createDebugRenderer() with NxOgre 0.9. I'm just trying to do something simple as this:
And it crashes in createDebugRenderer(). If I step through it, I track it to the constructor of DebugRenderer, where mNode is getting corrupted.
Here is the constructor:
It crashes on the 'mNode->setVisible(true)' call because mNode is corrupted.
If I don't call 'mWorld->createDebugRenderer(mSceneMgr)' everything works fine.
Any ideas as to what's going on? Doesn't seem like anyone else is having this problem and I didn't want to modify the engine code.
Unfortunately I don't have access to two systems so I have to use this method to debug.
*Note: This crash occurred on NxOgre 0.9 and also the latest Bleeding version as of today.
mWorld = new World();
mWorld->createDebugRenderer(mSceneMgr);
Scene *mScene = mWorld->createScene("myScene", mSceneMgr, "gravity: yes, renderer: ogre, controller: accumulator, floor: yes");
Body* body = mScene->createBody("Bob;ninja.mesh", new CubeShape(1.0f), Ogre::Vector3::ZERO, "mass: 10");
And it crashes in createDebugRenderer(). If I step through it, I track it to the constructor of DebugRenderer, where mNode is getting corrupted.
Here is the constructor:
DebugRenderer::DebugRenderer(Ogre::SceneManager *_mgr) {
mSceneMgr = _mgr;
mName = "NxDebugRenderer";
mNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(mName);
mNode->attachObject(this);
if(!Ogre::MaterialManager::getSingleton().resourceExists("NxOgre.DebugRenderer")) {
Ogre::MaterialPtr debugMat = Ogre::MaterialManager::getSingleton().create("NxOgre.DebugRenderer", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Ogre::Technique* tech = debugMat->createTechnique();
Ogre::Pass* pass = tech->createPass();
pass->setVertexColourTracking(Ogre::TVC_AMBIENT|Ogre::TVC_DIFFUSE);
pass->setDepthWriteEnabled(true);
pass->setLightingEnabled(true);
}
this->setMaterial("NxOgre.DebugRenderer");
mRenderOp.vertexData = new Ogre::VertexData();
mNode->setVisible(true);
setVisible(true);
}
It crashes on the 'mNode->setVisible(true)' call because mNode is corrupted.
If I don't call 'mWorld->createDebugRenderer(mSceneMgr)' everything works fine.
Any ideas as to what's going on? Doesn't seem like anyone else is having this problem and I didn't want to modify the engine code.
Unfortunately I don't have access to two systems so I have to use this method to debug.
*Note: This crash occurred on NxOgre 0.9 and also the latest Bleeding version as of today.