• Advertisement
Sign in to follow this  

Jump problem identify floor

This topic is 1902 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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;
Edited by Ashaman73

Share this post


Link to post
Share on other sites
I thought of that solutuin, but my floor can rotate,yaw,pitch. Will this work if the floor have a 20 degrees of bank?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement