Collision Detection (RESOLVED)

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
MerlinCAM
Posts: 6
Joined: Sun Jul 08, 2007 9:11 pm

Collision Detection (RESOLVED)

Post by MerlinCAM »

(The problem was with the elipse parameters, they were incorrect. when i use the following... it works.
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, node, core::vector3df(30,50,30),
core::vector3df(0,-3,0),
core::vector3df(0,50,0));
node->addAnimator(anim);
anim->drop();

Hello,

I'm using Irrlicht 1.3.1.

I have taken example 7 and placed a model in the scene. I have used a simple event handler to check key states and move the model in the main animation loop, this works fine. I have set a regular camera (not fps) to be a child of the model, and update the target of the camera in the main animation loop, this all seems to work correctly. My problem is with the collision detection,
I try to change the code from the example from camrea to node , and I cant get the animation to not go through walls ect. the example uses the following code:

//here is my animation code
//My animation is just this:
//node is declared as in the example
scene::IAnimatedMesh* anms = smgr->getMesh("../../media/sydney.md2");
node = smgr->addAnimatedMeshSceneNode(anms);
node->setPosition(core::vector3df(-70,0,-60));
node->setMD2Animation(scene::EMAT_RUN);
node->getMaterial(0) = material2;
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, anms, core::vector3df(30,50,30),
core::vector3df(0,-3,0),
core::vector3df(0,50,0));
camera->addAnimator(anim);
anim->drop();



WHen I change the collision detection code from camera to anms, it dosent stop my model from going through walls ect.

Any help is appreciated.
Last edited by MerlinCAM on Sun Jul 08, 2007 9:47 pm, edited 1 time in total.
MerlinCAM
Posts: 6
Joined: Sun Jul 08, 2007 9:11 pm

Update:

Post by MerlinCAM »

when I try this:

//attempt colision detection
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, node, core::vector3df(-10.0f, 10.0f, 0.0f),
core::vector3df(0,-3,0),
core::vector3df(-70,10,-60));
node->addAnimator(anim);
anim->drop();

my model will not move at all anymore.
Post Reply