[ODE] box-sphere collision bug?
Aras Pranckevicius
nearaz at interamotion.com
Tue Apr 29 00:15:02 2003
This is a multi-part message in MIME format.
------=_NextPart_000_0023_01C30E38.514ACD40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
Looking at the source of ODE's box-sphere collision (collision_std.cpp, =
dCollideSphereBox), the comment says "if sphere is inside the box, push =
the sphere to the closest box edge".
Now, it looks like the code projects the sphere center onto box axes, =
and pushes the sphere to the farthest box wall (not the nearest!) - =
shouldn't the code inside "if( !onborder )" choose the smallest 't' =
value, instead of the largest one?
Aras Pranckevicius aka NeARAZ
http://www.gim.ktu.lt/nesnausk/nearaz/
After some 15 hours of debugging, I've replaced the trimesh with a box =
geometry - now the wheels don't jump on tri edges (obviously), but the =
car tends to jump or dive in random places of the box anyway.
------=_NextPart_000_0023_01C30E38.514ACD40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Looking at the source of ODE's =
box-sphere collision=20
(collision_std.cpp, dCollideSphereBox), the comment says "if sphere is =
inside=20
the box, push the sphere to the closest box edge".</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Now, it looks like the code projects =
the sphere=20
center onto box axes, and pushes the sphere to the farthest box =
wall (not=20
the nearest!) - shouldn't the code inside "if( !onborder )" choose =
the=20
smallest 't' value, instead of the largest one?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> </DIV>
<DIV><BR></DIV></FONT><FONT face=3DArial size=3D2></FONT>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>Aras Pranckevicius aka NeARAZ<BR><A=20
href=3D"http://www.gim.ktu.lt/nesnausk/nearaz/">http://www.gim.ktu.lt/nes=
nausk/nearaz/</A></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial size=3D2>After some 15 hours of debugging, =
I've replaced=20
the trimesh with a box geometry - now the wheels don't jump on tri =
edges=20
(obviously), but the car tends to jump or dive in random places of the =
box=20
anyway.</FONT></DIV></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0023_01C30E38.514ACD40--