# 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.

## 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 on other sites
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 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 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.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633736
• Total Posts
3013599
×