Re: [Algorithms] Capsule vs OBB
Brought to you by:
vexxed72
|
From: Alen L. <ale...@cr...> - 2005-01-03 07:36:24
|
Here it is... (Actually, I've found these in my previous posts, so I'm just quoting it) ----- Original Message ----- From: "Alen Ladavac" <ale...@cr...> To: <gda...@li...> Sent: Friday, April 16, 2004 16:48 Subject: Re: [Algorithms] Capsule-OBB separating axes > Actually, it is not that hard to do a proper separating axis test. The axes > are: > > 1) 3 cross products of box axes with capsule main axis direction (to test > edges to capsule cylinder), > 2) 8 directions of lines perpendicular to capsule main axis, passing through > each of the box vertices (to test vertices to capsule cylinder, actually > catches the faces agains capsule cylinder as a side effect), > 3) 2 "Arvo's axes", one for each capsule sphere (this catches capsule caps > against anything on the cube). > > What I like to call "Arvo's axis" is what you get from the Arvo's algorithm > if you track actual direction vector instead of distance. Note that you > cannot just do Arvo's algo for both spheres because you cannot get any > useful result from that for the entire capsule (at least I didn't find any), > so you need to find the axis resulting from it and then do a usual > separating axis test. and.... ----- Original Message ----- From: "Alen Ladavac" <ale...@cr...> To: <gda...@li...> Sent: Wednesday, November 26, 2003 08:08 Subject: Re: [Algorithms] point-OBB separating plane > There is a simple solution that covers all the border cases. A simple > modification of the Arvo's algorithm (point-box distance) allows you to get > the distance vector instead of the distance itself. The distance vector is > then your separating direction. Like this: > > for i=0..2 > if vPoint[i] < -vBoxHalfSize[i] > vDelta[i] = vPoint[i] + vBoxHalfSize[i] > else if vPoint[i] > vBoxHalfSize[i] > vDelta[i] = vPoint[i] - vBoxHalfSize[i] > else > vDelta[i] = 0 > > (vPoint and vDelta are in box space) HTH, Alen ----- Original Message ----- From: "Alen Ladavac" <ale...@cr...> To: <gda...@li...> Sent: Thursday, December 30, 2004 22:57 Subject: Re: [Algorithms] Capsule vs OBB > There is a fixed number of potential separating axes to test, and the whole > thing is relatively simple. I believe this might have been already discussed > on the list. If not, I'll post the list of axes next year. > > Alen > > ----- Original Message ----- > From: "Travis Nixon" <tn...@av...> > To: <gda...@li...> > Sent: Thursday, December 30, 2004 7:37 PM > Subject: [Algorithms] Capsule vs OBB > > > > I'm looking for a quick test to see if a capsule (line-swept-sphere) and > > an OBB are intersecting. > > > > So far, all I've come across is to find the distance between the > > capsule's axis and the obb, and compare that to the radius of the > > capsule, but the math for finding the distance between a line segment > > and an OBB looks to be incredibly hairy. I'm looking in "Geometric > > Tools for Computer Graphics" (Schneider & Eberly) right now, but the > > code in there for just one of the possible cases is 4-5 pages long. It > > actually doesn't look too horrible, since most of it is a big collection > > of nested if/else clauses, so the actual amount of code run for each > > individual case is probably pretty small, but it still looks like a lot > > more math than the obb/obb separating axis test we were using before. > > > > So, is there a quick yes-or-no test? I wouldn't mind running all that > > extra code if I knew they were actually intersecting, but I'm hoping for > > a quicker method. > > > > I tried coming up with a separating axis test, but one of the possible > > separating axes is an axis perpendicular to the cylinder's axis, in the > > direction of the nearest feature on the box. > > > > Obviously, if I could determine the nearest feature on the box quickly, > > I wouldn't need a separating axis test in the first place. :) > > > > I'm already doing a quick double-sphere check (a sphere totally > > enclosing the capsule vs one totally enclosing the obb) as a quick > > rejection test, so maybe it would be tolerable to run the more intensive > > one when the spheres intersect, but it seems there really ought to be a > > quicker way. > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by: Beat the post-holiday blues > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDA...@li... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > |