Jump to content

  • Log In with Google      Sign In   
  • Create Account

Jump problem identify floor


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 KurtO   Members   -  Reputation: 230

Like
0Likes
Like

Posted 06 November 2012 - 06:42 AM

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?

Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 7573

Like
0Likes
Like

Posted 06 November 2012 - 07:26 AM

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, 06 November 2012 - 07:32 AM.


#3 KurtO   Members   -  Reputation: 230

Like
0Likes
Like

Posted 06 November 2012 - 09:37 AM

I thought of that solutuin, but my floor can rotate,yaw,pitch. Will this work if the floor have a 20 degrees of bank?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS