FPS collision problems

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
admgamer
Posts: 21
Joined: Tue Feb 12, 2008 10:49 am

FPS collision problems

Post by admgamer »

Hi never really dealt with collison models in irrlicht but i'm having a bit of a lame problem.

FPS camera, mesh is basically the inside of a room.

If i walk around etc i'm stopped from walking through the walls, but lets say you turn around whilst moving against the wall etc you sometimes get stuck, and then i can fall through the mesh and i fall to my doom.

this is my code, if anyone has any suggestions i'd be more than grateful:

Code: Select all

IAnimatedMesh* innmesh = gameData.m_Smgr->getMesh("inn/inn_mesh.3ds");
scene::ISceneNode* inn = 0;
inn = gameData.m_Smgr->addAnimatedMeshSceneNode(innmesh);

scene::ITriangleSelector* selector = 0;
selector = gameData.m_Smgr->createOctTreeTriangleSelector(innmesh->getMesh(0), inn, 128);

gameData.m_Camera = gameData.m_Smgr->addCameraSceneNodeFPS(0, 75,100,-1,keyMap,4);

// Mesh collision for inn
scene::ISceneNodeAnimator* mesh_anim =
gameData.m_Smgr->createCollisionResponseAnimator(
selector, gameData.m_Camera, core::vector3df(10,50,10),
core::vector3df(0,-3,0),
core::vector3df(0,50,0));
gameData.m_Camera->addAnimator(mesh_anim);
mesh_anim->drop();
Post Reply