collsion detection tutorial??
collsion detection tutorial??
I tried to implement collsion detection into the special effects tutorial that is provided on the main website. However its not really detecting my collsions :/. It however has a like the triangle in the view of the camera in front of me becomes highlighted with a red boarder. Yet I still can go though the walls maybe im missing somthing here 0.o? I haven't ever implemented 3d collsion detection and im not quite sure how to make it respond and detect a collision with the camera/player.
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
Did you add your main triangle selector to the camera with an animator? Kinda like this:
Code: Select all
anim = smgr->createCollisionResponseAnimator(mainTriangleSelector, Camera, core::vector3df(30,50,30), core::vector3df(0,0,0), 100.0f, core::vector3df(0,20,0));
Camera->addAnimator(anim);
anim->drop();
scene::ISceneNodeAnimator* scen_anmi = smgr->createCollisionResponseAnimator(
selector, node, core::vector3df(30,50,30),
core::vector3df(0,-100,0), 100.0f,
core::vector3df(0,50,0));
// camera->addAnimator(scen_anmi);
scen_anmi->drop();
is what i did i commented out the camera add animator cuz it didnt seem to work :/
it caused game to crash
selector, node, core::vector3df(30,50,30),
core::vector3df(0,-100,0), 100.0f,
core::vector3df(0,50,0));
// camera->addAnimator(scen_anmi);
scen_anmi->drop();
is what i did i commented out the camera add animator cuz it didnt seem to work :/
it caused game to crash
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
-
- Posts: 32
- Joined: Sun Nov 23, 2003 10:23 pm
Hi
the createCollisionResponseAnimator has another value at the end (slidingValue)
f32 sliding = 0.0005f;
smgr->createCollisionResponseAnimator(selector, camera, core::vector3df(30, 35, 30),
core::vector3df(0,-10,0), 100.0f, core::vector3df(0, 17, 0), sliding);
Try with different values, not easy to find the right one (at least for me, still trying).
Cheers
the createCollisionResponseAnimator has another value at the end (slidingValue)
f32 sliding = 0.0005f;
smgr->createCollisionResponseAnimator(selector, camera, core::vector3df(30, 35, 30),
core::vector3df(0,-10,0), 100.0f, core::vector3df(0, 17, 0), sliding);
Try with different values, not easy to find the right one (at least for me, still trying).
Cheers