pyrokar
05-06-2007 13:32:52
Hello
I really hope there is someone out there who can answer me.
I want to use BSP Collision with OgreODE.
And i saw that there is a OgreSceneManagerSpace which seems to be what i need. But it doesn't work.
i tried it this way:
is is the interesting line:
I don't really know that the Depth parameter is here, so i tried some values.
Everything >12 will cause a SegFault for me o.O, so i did set it to 12.
Am i doing anything wrong?
The Test-Entity is ony falling thoug the BSP map, it doesnt collide.
I really hope there is someone out there who can answer me.
I want to use BSP Collision with OgreODE.
And i saw that there is a OgreSceneManagerSpace which seems to be what i need. But it doesn't work.
i tried it this way:
mSceneMgr->setWorldGeometry("ogretestmap.bsp");
mWorld = new World(mSceneMgr);
mWorld->setGravity(Vector3(0,0,-9.80665));
mWorld->setCFM(10e-5);
mWorld->setERP(0.8);
mWorld->setAutoSleep(true);
mWorld->setContactCorrectionVelocity(1.0);
mWorld->setShowDebugGeometries(true);
mSpace = new OgreSceneManagerSpace(Vector3(0, 0, 0), Vector3(1000, 1000, 1000), 12, mSceneMgr, mWorld, mWorld->getDefaultSpace());
mStepper = new ForwardFixedStepHandler(mWorld, StepHandler::QuickStep, 0.01, Ogre::Real(1.0 / 4), Ogre::Real(1.7));
mBody = new Body(mWorld, "TestBody");
mEntity = mSceneMgr->createEntity("Test", "Test.mesh");
mEntity->setCastShadows(true);
mEntity->setUserObject(mBody);
EntityInformer ei(mEntity);
TriangleMeshGeometry* geometry = ei.createStaticTriangleMesh(mWorld, mSpace);
geometry->setBody(mBody);
mSceneMgr->setAmbientLight(ColourValue(0, 0, 0));
mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);
mNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("TestNode");
mNode->translate(-50, -50, 80);
mNode->pitch(Degree(250));
mNode->attachObject(mEntity);
mNode->attachObject(mBody);
mCamera->pitch(Degree(90)); // Quake uses X/Y horizon, Z up
mCamera->setFixedYawAxis(true, Vector3::UNIT_Z); // Don't yaw along variable axis, causes leaning
is is the interesting line:
mSpace = new OgreSceneManagerSpace(Vector3(0, 0, 0), Vector3(1000, 1000, 1000), 12, mSceneMgr, mWorld, mWorld->getDefaultSpace());
I don't really know that the Depth parameter is here, so i tried some values.
Everything >12 will cause a SegFault for me o.O, so i did set it to 12.
Am i doing anything wrong?
The Test-Entity is ony falling thoug the BSP map, it doesnt collide.