Sign in to follow this  
JesusGumbau

Player colliding with the environment

Recommended Posts

I found this paper helpful:

http://www.peroxide.dk/papers/collision/collision.pdf

It dates back to 2003 but the base algorithms involved in collision detection and response are covered. As for the implementation details there are probably better papers around, but IMHO it's a good place to start.

Share this post


Link to post
Share on other sites
It does not, this is what I mean:



As you can see, there is an obvious collision between the sphere and the triangle edge, but the reversed normal that is supposed to give you the collision point does not hit the triangle, and the sphere misses the collision.

I implemented this algorithm years ago, that's how I know there is a bug in it, as it turns out, this situation is very common, it happens by just applying gravity on a character standing on the edge of a cliff, step, sidewalk, etc.

Share this post


Link to post
Share on other sites
Exactly, I have done some tests and noticed the whole sphere (or ellipsoid) colliding correctly with triangles and edges and it works like a charm.

Maybe you implemented an early version of this paper with a bug that has now been solved.

Share this post


Link to post
Share on other sites
As good as the peroxide code is for learning and getting to grips with many aspects of collision and coding i've found it to be unreliable and believe its fundamentally flawed. Which is a great shame as its one of the most complete tutorials on the web (that i've found) and is well written. Thats not to say it doesn't work as such, as it does, often very well. However i kept running into rare instances where it would fail. Although very rare, it happened enough to make me uncomfortable with using it.

The specific issue is to do with the use of an ellipsoid in the first place. There was a very good discussion on gdAlgorithms at the time about it, where some very knowledgeable person detailed the issues it had that would cause it to be unreliable. Unfortunately I don't remember the exact aspects of it now,must have been a good 4-5 years ago and at times some of it was over my head.

This is not to say the peroxide tutorial is not a great place to start, but i'd look into using an AABB as the collision volume/primitive as opposed to an ellipsoid. At least in my experience thats been the most reliable volume to use.

There is a second ellipsoid paper by Paul Nettle which is here on gamedev. Recommended to read both of them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this