I know that there are a lot of questions about collision detection in the beginners forum, but i read the replys, and there was no answer for mine.
I build a terrain for a FPS and want to do this with unic files (all 3ds format). I do it like in the tutorial with a collision response animator.
Now my problem is that i only can give one file to the animator.
I do it with this:
Code: Select all
ITriangleSelector* selector = 0;
IAnimatedMesh* t1 = smgr->getMesh("file1.3ds");
ISceneNode* terrain1 = smgr->addOctTreeSceneNode(t1->getMesh(0));
if (terrain1)
{
selector = smgr->createOctTreeTriangleSelector(t1->getMesh(0), terrain1, 128);
terrain1->setTriangleSelector(selector);
selector->drop();
}
IAnimatedMesh* t2 = smgr->getMesh("file2.3ds");
ISceneNode* terrain2 = smgr->addOctTreeSceneNode(t2->getMesh(0));
if (terrain2)
{
selector = smgr->createOctTreeTriangleSelector(t2->getMesh(0), terrain2, 128);
terrain2->setTriangleSelector(selector);
selector->drop();
}
ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(selector, cameraFPS,
vector3df(10,10,10),vector3df(0,-1,0), vector3df(0,5,0));
cameraFPS->addAnimator(anim);
anim->drop();
Can please somebody help me with this newbie question?
Excuse my bad c++ and also my worse english!!