i have a little problem with my walls .
if i drive with my car , i can go through to my walls .
how can i solve that ?
walls intro my racegame issues
You need to add in Collision Detection. Check out this tutorial to lear how to do it: http://irrlicht.sourceforge.net/tut007.html
Well first you need to create a Triangle Sleecter for your mesh:
Then you need to apply a Collision Animator to whatever it is you're controlling; Like a racing car:
It's all in the tutorial I posted.
Code: Select all
scene::ITriangleSelector* selector = 0;
selector = smgr->createOctTreeTriangleSelector(levelmesh->getMesh(0), levelnode, 128);
levelnode->setTriangleSelector(selector);
selector->drop();
Code: Select all
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(selector, carNode, core::vector3df(30,50,30), core::vector3df(0,-3,0), core::vector3df(0,50,0));
carNode->addAnimator(anim);
anim->drop();
its dont whont to works .
i've this code
i've this code
Code: Select all
scene::ITriangleSelector* selector = 0;
scene::ICameraSceneNode* camera =
smgr->addCameraSceneNodeFPS(0, 100.0f, 300.0f, -1, 0, 0, true);
camera->setPosition(core::vector3df(-200,125,-150)); // die 125 is hoogte van u screenventje
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, camera, core::vector3df(30,50,30),
core::vector3df(0,-3,0),
core::vector3df(0,90,0));
camera->addAnimator(anim);
anim->drop();
device->getCursorControl()->setVisible(false);
//--- licht
smgr->addLightSceneNode(0, core::vector3df(-60,100,400),
video::SColorf(1.0f,1.0f,1.0f,1.0f),
600.0f);
//----------------
scene::ISceneNode* selectedSceneNode = 0;
scene::ISceneNode* lastSelectedSceneNode = 0;
Hi,
As Xharock said above.
Your selector is 0, you havent told it to collide with anything !!

As Xharock said above.
Your selector is 0, you havent told it to collide with anything !!
Code: Select all
scene::ITriangleSelector* selector = 0;
selector = smgr->createOctTreeTriangleSelector(levelmesh->getMesh(0), levelnode, 128);
levelnode->setTriangleSelector(selector);
selector->drop();

You scratch my back, I'll scratch yours.