I need to collision detection with IAnimatedMeshSceneNode!
Posted: Fri May 05, 2006 9:47 am
I've really tried all the possible way to collisiosn detection with IAnimatedMeshSceneNode .... but with no result ..
Still the camera fly thrugh my SceneNode, and it doesn't colide with it!
Any help please!
here is the code
Still the camera fly thrugh my SceneNode, and it doesn't colide with it!
Any help please!
here is the code
Code: Select all
int main()
{
....
....
....
IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setFrameLoop(0, 310);
node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
}
ICameraSceneNode* camera;
camera = smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
camera->setPosition(vector3df(-100, -100, 100));
ITriangleSelector* selector;
selector = smgr->createTriangleSelectorFromBoundingBox(node);
ISceneNodeAnimator* anim;
anim = smgr->createCollisionResponseAnimator
(selector, node, vector3df(50, 50, 50), vector3df(0, 0, 0), vector3df(0, 20, 0), 0.000500);
node->addAnimator(anim);
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
return 0;
}