Page 1 of 1

Gravity or small feet?

Posted: Sat Jan 03, 2004 10:19 am
by Keanu
Well my new problem is I made a small terrain wich is all flat and in one corner has a soft slope. When my player (attached to a collision response animator) reaches the junction point, collides!It doesn't walk forward but stops! Is that caused because I never update the Y coordinate of my player. If I grow up it a little when walking my player can walk on slopes or on stairs but it seems to be jumping. Next question: it's normal that also if the gravity is at min (not 0), very small, my player on a slope continues to fall down, gently, but always going down. There's a way to change this?[img]c:\juza.bmp[/img]

Posted: Sun Jan 04, 2004 5:18 am
by keless
first of all, i havent done collision detection in Irrlicht yet, so what Im about to say is just general knowledge.


Generally for slopes and steps, there is used the following algorithm:
1) see if proposed path collides, if so:
2) project the players position up a 'step' and project forward from there
3) if that works, then move that way (you've just walked up a stair/slope)

For the sliding thing:
if you imagine a ball or a box on a slope, it would slide right? So what is the difference between a ball and a person? the person is going to adjust their limbs in a way so that they dont slide. You cant model that in your collision detection because you're simplifying the person with a bounding box or sphere-- so instead, you'll need special code. Generally, when a person is on the ground, a 'on ground' or 'walking' flag is set. This snaps the person to the ground, and you dont have to apply gravity to them, since you know they wont be able to fall thru the ground.

Posted: Sun Jan 04, 2004 10:55 am
by Keanu
Thank you as always keless to answer my stupid-looking questions. But the important thing is: there's a smooth way to go up stairs or slopes without manually modifying the Y coord of my player? I tried everything but I could go up stairs only in the collision demo. It depeends on the bounding box?(I used the way described in the tutorial to get the radius of the elipsoyd)
Please help me

Posted: Sun Jan 04, 2004 9:29 pm
by R00mpel
I had the same problem: my camera didn't go up slopes... But i solved it by using OpenGL mode. You can also try to look parallel to the ground - sometimes it helps...

Posted: Wed Jan 07, 2004 1:23 pm
by Keanu
I tryed using OpenGL also if I don't know what does it change, but it doesn't work. The camera looks parallel to the ground, I tryed also make it look a bit upward but still it doesn't work. Maybe I think it's time to have a detailed explanation of how the collision response animator works in Irrlicht. Anybody can help :?:

Posted: Tue May 11, 2004 4:41 pm
by luvcraft
I think the problem with stairs is that you're not putting the "bounding elipsoid" around your camera or your player. Without that elipsoid, your camera is just a single point, so even the smallest stairstep is infinitely high in comparison. Look at the collision detection tutorial for an example of how to apply it to the camera, and for the player, look at the API for setEllipsoidRadius.

Posted: Tue May 11, 2004 5:23 pm
by R00mpel
If someone still experiences this problem, it's possible source is too low sliding value (it is the last parameter of the createCollisionResponseAnimator(...) function) :roll: