collsion detection tutorial??

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Spartacus
Posts: 70
Joined: Fri Nov 21, 2003 11:56 pm

collsion detection tutorial??

Post by Spartacus »

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.
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

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();
:?:
Spartacus
Posts: 70
Joined: Fri Nov 21, 2003 11:56 pm

Post by Spartacus »

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
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

uh uh... thats what adds the collision detection to the camera. Uncomment it and it should work. If it's crashing then the problem is somewhere in making the map's triangle selector.
Spartacus
Posts: 70
Joined: Fri Nov 21, 2003 11:56 pm

Post by Spartacus »

everything looks right.. just not working still :/ if anyone else has any ideas
Guest

Post by Guest »

Hi

Correct me if I am wrong but I think it has to be
scene::ISceneNodeAnimator* scen_anmi = smgr->createCollisionResponseAnimator(selector, camera, ...
instead of (selector, node, ...

Cheers
Spartacus
Posts: 70
Joined: Fri Nov 21, 2003 11:56 pm

Post by Spartacus »

OMG YOUR A GENIUS IT WORKS! ^^ However i can climb up walls like spiderman
Last edited by Spartacus on Mon Nov 24, 2003 11:33 pm, edited 1 time in total.
Harry_Mystic
Posts: 32
Joined: Sun Nov 23, 2003 10:23 pm

Post by Harry_Mystic »

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
Post Reply