I've a very simple level setup at the moment. The player has an FPS style camera, is stood in a large room with a cube at the centre (the idea is the player throws rocks at the deformable cube, for a deformation project). I have recently noticed that all of the meshes are quivering slightly in the y-direction. It's only slight at first, but the more I move around the level the greater the quivering gets, and finally the player camera begins to hop up and down furiously before falling through the level.
I'm guessing it's something to do with the collision detection between the player and the level itself (causing the player to "quiver" his way through the base). My current collision code is as follows:
Code: Select all
IAnimatedMesh* mesh = smgr->getMesh("collisionplayroom.b3d");
ISceneNode* node = 0;
if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
ITriangleSelector* selector = 0;
if (node)
{
node->setPosition(vector3df(-16,0,0));
selector = smgr->createOctTreeTriangleSelector(mesh->getMesh(0), node, 128);
node->setTriangleSelector(selector);
selector->drop();
}
m_cam = smgr->addCameraSceneNodeFPS(0,100,30);
m_cam->setPosition(vector3df(-20,7,0));
m_cam->setTarget(vector3df(50, 0, 0));
ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, m_cam, vector3df(2,3,2),
vector3df(0,-10,0),
vector3df(0,3,0));
m_cam->addAnimator(anim);
anim->drop();