If i turn it down, and the game runs at about 50 fps, everything works (somewhat) fine, however if I turn it up and run at about 140 fps, i get stuck almost everywhere?
This is the parts having to do with collision. If anyone has a better method of doing this, please let me know.
Code: Select all
// Load Ground mesh
groundmesh = GameMain::getSceneManager()->getMesh("./GameData/Ground/ground.b3d");
groundnode = CGameMain::getSceneManager()->addOctTreeSceneNode(groundmesh,0,-1,256,false);
groundnode->setMaterialFlag(video::EMF_LIGHTING, true);
groundnode->setMaterialFlag(video::EMF_GOURAUD_SHADING, true);
// Add Triangle selector
selector = CGameMain::getSceneManager()->createOctTreeTriangleSelector(CEnvironment::getGroundMesh()->getMesh(0), CEnvironment::getGroundNode(), 256);
CEnvironment::getGroundNode()->setTriangleSelector(selector);
triselector->addTriangleSelector(selector);
selector->drop();
// Add Collision Responce Animator
scene::ISceneNodeAnimator* anim = CGameMain::getSceneManager()->createCollisionResponseAnimator(triselector,
camera,vector3df(50,80,50),vector3df(0,-0.9f,0),vector3df(0,35,0),0.05f);
camera->addAnimator(anim);
anim->drop();
// Add Camera
camera = CGameMain::getSceneManager()->addCameraSceneNodeFPS(0, 100, 300, -1, keyMap, 8);
download http://harme.dk/dead/dead.rar (36MB)
edit: using irrlicht 1.2