Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
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.
Posted 07 May 2012 - 10:09 AM
Posted 07 May 2012 - 01:33 PM
Its the minimum positive separating axis distance, isn't it?
Edited by alvaro, 07 May 2012 - 01:34 PM.
Posted 07 May 2012 - 03:11 PM
Posted 08 May 2012 - 03:45 AM
Is this what you want?
sqrt(pow(x_separation, 2) + pow(y_separation, 2) + pow(z_separation, 2))
Ahh yes, of course - I'd forgotten it worked differently for separation compared with penetration. With separation you need to account for more than just the separating axis themselves, you also need to account for the geometry of the faces and edges.
Penetration is different because you only need to worry about the actual axis formed by the faces of both objects and the cross-products of the edges.
In this article I wrote, you can see the problem you need to address:
http://www.wildbunny...on-for-dummies/
Scroll down to the section on OBB vs OBB - there is a little applet demonstrating the difference I was describing. The axis is shown as the line from the centre of the applet to a face on B-A. When this axis is aligned with a face of A or B, the minimum distance is aligned with a separating axis. However, when that axis is not aligned, the distance is actually that of two vertices. In 3d there is vertex vs vertex and edge vs edge distance as well.
Hope that helps!
Cheers, Paul.
Posted 08 May 2012 - 05:41 AM
Thanks for your ideas.
Is this what you want?
sqrt(pow(x_separation, 2) + pow(y_separation, 2) + pow(z_separation, 2))
I think this only works for axis-aligned bounding boxes? I use oriented bounding boxes...
Posted 08 May 2012 - 07:18 AM
You are right. The word "oriented" threw me off: I thought an arbitrary bounding box would just be called a "bounding box". After a quick web search I see that your name is perfectly common.
I am pretty sure you cannot deduce the distance between two boxes from the projections alone, but perhaps there is something else I don't understand, since you seem to be testing 15 axes, and I can only think of 6 that matter. Would you mind explaining where the 15 axes come from?
Edited by Nokobon, 08 May 2012 - 08:29 AM.
Posted 08 May 2012 - 12:03 PM
Interesting approach. This might be a good solution for the problem but it would require a whole new implementation and I could discard my separating axis test.
My main question is:
Is the distance parallel to on of the 15 axes as if the penetration depth?
If so I could use the separating axis test results to calculate it...
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.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.