Gravity or small feet?
Gravity or small feet?
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]
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.
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.
a screen cap is worth 0x100000 DWORDS
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
Please help me
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
P4 2.53MHz 256MB GeForce4Mx VC++6.0
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.