Moving Sphere against AABB Collision
Looks like my SphereMoveHitsBox code has a bug yielding false positives. Looking around the net though I could not find a working example of a moving sphere against AABB collision test. Anybody knows how this can be done if it can be done?
I've checked this place already. There is no "moving" sphere-aabb test only a static sphere-aabb test... unless I overlocked something.
You can either step the sphere along the path, ie a swept sphere, or possibly use the sphere's displacement as a ray and see if it intersects the box.
Ericson's Real Time Collision Detection is excellent and I think has some examples of a swept sphere.
Ericson's Real Time Collision Detection is excellent and I think has some examples of a swept sphere.
A stepped sphere is not an option, I need correct TOI (Time Of Impact). What's this "Ericson's Real Time Collision Detection"?
Quote:Original post by RPTDTake another look at the 'intersection' section (there's a section with the heading 'Intersection of boxes and spheres (3D). Includes the cases of moving spheres and boxes.').
I've checked this place already. There is no "moving" sphere-aabb test only a static sphere-aabb test... unless I overlocked something.
Quote:Original post by RPTDIt's a book by Christer Ericson. (I don't have it in front of me right now, but IIRC it doesn't cover the specific case of moving sphere-vs.-box. Again though, I'm not looking at it right now, so don't hold me to that. If you want to know for sure, you could probably find the TOC online somewhere.)
What's this "Ericson's Real Time Collision Detection"?
I could be blind but there is no entry under "Intersection" even remotely matching the suggested name. The only thing I found is "Intersection of Convex Objects: The Method of Separating Axes" which also contains SAT for moving objects. Unfortunately this doesn't seem to properly work with sphere versus a box. I implemented this one and it works in some cases but the simple case of a sphere moving along a box axis towards an edge without hitting it results in incorrect early collision. Most probably incomplete axis set but I really have no idea anymore what else I could include (I'm using box axis x/y/z, moving direction and moving direction cross box axis x/y/z).
Ah, found it now. I always looked under the "documentation" place as this is where the papers are located. Thanks for the tip.
Took a look at the sources. From what I get they use something similar to mine just with the problem that this is not correctly working. An important border case is not handled which is exactly the one causing me to look for a better algorithm. Shoot... looks like their code example won't be of help as it is incomplete as mine.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement