Jump to content
  • Advertisement
Sign in to follow this  
Sepiantum

Quick question about collision detection

This topic is 2528 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

So you have a really thick wall that a player interacts with. For collision detection, how do you distinguish between the player falling on top of the wall and the player walking into the wall?

Share this post


Link to post
Share on other sites
Advertisement
A "wall" (assume a rectangle) is probably defined by six quads which represent its faces, so a player falling on top of the wall with collide with the top surface whereas a player walking into the wall will collide with either of the four vertical faces. This is how you distinguish between the two cases (you could also distinguish by looking at the player's velocity, if he's going down he's falling, otherwise he is walking... but that is... non-scalable at best)

Share this post


Link to post
Share on other sites
Looking at velocity is not enough, as you could be falling and hit the side surface if he misses the top. And I am only able to do bounding box collision detection, so if someone could point me to surface collision detection, that would be very helpful.

Share this post


Link to post
Share on other sites
Using player's velocity is not an option. I've seen it fail so many cases I don't count it anymore.
It is necessary to resolve contact points and hit normals. For bounding boxes, that's not much of a big issue but the problem rapidly becomes nontrivial.
Using a physics library (bullet, Box2d) is strongly suggested.

Using normal comparisons is commonplace AFAIK.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!