Advertisement

Overlapping OBB's

Started by June 24, 2003 01:11 PM
4 comments, last by stefu 21 years, 7 months ago
Hello Is there algorithm to find for two overlapping OBB''s: 1. Plane (approximation) that ''separates'' the OBB''s. 2. Point that is in the plane, and center of collision. The second I can imagine finding myself, but I need help finding proper algorithm for the first. Thanks.
1. The plane that separates the two bounding boxes is either one of the planes of the two OBBs, or a plane formed by an edge from OBB A and an edge from OBB B. I''m sure that the forum archives and Google contain plenty of information about collision detection of boxes.

2. Sorry, but I don''t understand what you mean.

Also, do you want something that just works, or something that''s as fast as it can be.

Again, Google is your friend.

Cédric
Advertisement
Yeah, google is my best friend ever.
The first is solved and second too. I just mean a point at where I apply impulse at the planes normal direction in collision response. I just can''t impulse somewhere eyeblind.
Thanks
I solved it, by storing the results of the span overlap for each axis (take the two box extents along the axis, and compute the length where the box min-max ranges overlap. easy as pie).

And if the boxes intersect, I go through all the axes, normalise the axes and the overlap distance (divide by the axis vector length, like for the axis unit vector), and use the one with the minimum overlap distance. That gives me both the penetration depth, and the normal of collision. Then depending on how the separation axis was build (edge-edge axis, or point-plane axis, ...), I compute the point of intersection. For edge-edge, I find the two points on each edges that are the closest (simple 3D segment-segment ''intersection'' test). For a point-plane, it''s even simpler. It''s the point and it''s projection on the plane of the other box.

Amazingly, it works

Everything is better with Metal.

Wow, thanks.
But I didn''t understand everything. Do you know any tutorials (with pictures)?
I found this paper online a while ago and implemented some of the ideas from it. There aren''t any diagrams but the concepts and math aren''t too complicated (mostly vector/matrix math, with a few references to basic statistics) and it has a lot of pseudo C code. It works its way through static collision detection, collision detection with constant velocity, and the time and point of collisions. It does this for OBB-OBB, OBB-triangle, and triangle-triangle collisions. It also has an algorithm for generating an OBB tree for an arbitrary triangle mesh. It finally wraps it all up with pseudo C code for a complete collision detection system based on the algorithms.

This topic is closed to new replies.

Advertisement