Hi. I have a problem in my fps game engine. I cant seem to figure och which triangles in my level that is the floor.
Basically now the player can jump again as soon as i touch any wall/floor/roof. But i want the player only to jump again if location is on the floor.
My collision detection is calc length to triangle and push the player out the amount it is to close from sphere radius.
Any ideas?
Jump problem identify floor
A simple solution is to check the surface normal and let the char only jump it is almost pointing up.
<=>
if( dot(surface_normal, up_vector)>threshold)
jump;
<=>
// assumption: y pointing up
if( surface_normal.y>threshold)
jump;
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement