[ODE] Bug in dCylinder contrib

Eric Trousset eTrousset at wanyrobotics.com
Fri Mar 7 07:46:02 2003


This is a multi-part message in MIME format.

------_=_NextPart_001_01C2E4B8.47149820
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi every body,
I've found a lite bug in dCylinder contrib!
When colliding with aplane, the contact points where generated has if =
the length was multplied by 2.
=20
The only thing needed to crrect this is to devide lhz by 2 :
=20
int dCollideCylPlane=20
 (
 dxGeom *o1, dxGeom *o2, int flags,
     dContactGeom *contact, int skip){
  dIASSERT (skip >=3D (int)sizeof(dContactGeom));
  dIASSERT (dGeomGetClass(o1) =3D=3D dCylinderClassUser);
  dIASSERT (dGeomGetClass(o2) =3D=3D dPlaneClass);
  contact->g1 =3D const_cast<dxGeom*> (o1);
  contact->g2 =3D const_cast<dxGeom*> (o2);
 =20
 unsigned int ret =3D 0;
=20
 dReal radius;
 dReal hlz;
 dGeomCylinderGetParams(o1,&radius,&hlz);
 hlz /=3D  2;

best regards,
eric
----------------------------------------=20
 Eric TROUSSET=20
 Ing=E9nieur developpement=20
  mailto:eric.trousset@wanyrobotics.com=20
 =20
 WANY SA=20
 CEEI Cap Alpha=20
 Avenue de l'Europe, Clapiers=20
 34940 Montpellier Cedex 9=20
 =20
  http://www.wanyrobotics.com <http://www.wanyrobotics.com/> =20
----------------------------------------=20


------_=_NextPart_001_01C2E4B8.47149820
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=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">


<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR></HEAD>
<BODY style=3D"COLOR: #000000; FONT-FAMILY: Arial">
<DIV><SPAN class=3D597364114-07032003><FONT size=3D2>Hi every=20
body,</FONT></SPAN></DIV>
<DIV><SPAN class=3D597364114-07032003><FONT size=3D2>I've found a lite =
bug in=20
dCylinder contrib!</FONT></SPAN></DIV>
<DIV><SPAN class=3D597364114-07032003><FONT size=3D2>When colliding with =
aplane, the=20
contact points where generated has if the length was multplied by=20
2.</FONT></SPAN></DIV>
<DIV><SPAN class=3D597364114-07032003><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D597364114-07032003><FONT size=3D2>The only thing =
needed to crrect=20
this is to devide lhz by 2 :</FONT></SPAN></DIV>
<DIV><SPAN class=3D597364114-07032003><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D597364114-07032003><FONT size=3D2>int =
dCollideCylPlane=20
<BR>&nbsp;(<BR>&nbsp;dxGeom *o1, dxGeom *o2, int=20
flags,<BR>&nbsp;&nbsp;&nbsp;&nbsp; dContactGeom *contact, int =
skip){<BR>&nbsp;=20
dIASSERT (skip &gt;=3D (int)sizeof(dContactGeom));<BR>&nbsp; dIASSERT=20
(dGeomGetClass(o1) =3D=3D dCylinderClassUser);<BR>&nbsp; dIASSERT =
(dGeomGetClass(o2)=20
=3D=3D dPlaneClass);<BR>&nbsp; contact-&gt;g1 =3D =
const_cast&lt;dxGeom*&gt;=20
(o1);<BR>&nbsp; contact-&gt;g2 =3D const_cast&lt;dxGeom*&gt; =
(o2);<BR>&nbsp;=20
<BR>&nbsp;unsigned int ret =3D 0;</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=3D597364114-07032003><FONT size=3D2>&nbsp;dReal=20
radius;<BR>&nbsp;dReal=20
hlz;<BR>&nbsp;dGeomCylinderGetParams(o1,&amp;radius,&amp;hlz);<BR><FONT=20
color=3D#ff0000>&nbsp;hlz /=3D&nbsp; 2;<BR></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=3D597364114-07032003><FONT size=3D2><FONT =
color=3D#ff0000><FONT=20
color=3D#000000>best regards,</FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=3D597364114-07032003><FONT size=3D2><FONT =
color=3D#ff0000><FONT=20
color=3D#000000>eric</FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=3D597364114-07032003><FONT size=3D2><FONT =
color=3D#ff0000>
<P><FONT color=3D#000000><FONT face=3D"Courier New"=20
size=3D2>----------------------------------------</FONT> <BR><FONT=20
face=3D"Courier New" size=3D2>&nbsp;Eric TROUSSET</FONT> <BR><FONT=20
face=3D"Courier New" size=3D2></FONT>&nbsp;<FONT face=3D"Courier New" =
size=3D2>Ing=E9nieur=20
developpement</FONT> <BR><FONT face=3D"Courier New" size=3D2>&nbsp;<A=20
href=3D"mailto:eric.trousset@wanyrobotics.com">mailto:eric.trousset@wanyr=
obotics.com</A></FONT>=20
<BR><FONT face=3D"Courier New" size=3D2>&nbsp;</FONT> <BR><FONT =
face=3D"Courier New"=20
size=3D2>&nbsp;WANY SA</FONT> <BR><FONT face=3D"Courier New" =
size=3D2>&nbsp;CEEI Cap=20
Alpha</FONT> <BR><FONT face=3D"Courier New" size=3D2>&nbsp;Avenue de =
l'Europe,=20
Clapiers</FONT> <BR><FONT face=3D"Courier New" size=3D2>&nbsp;34940 =
Montpellier=20
Cedex 9</FONT> <BR><FONT face=3D"Courier New" size=3D2>&nbsp;</FONT> =
<BR><FONT=20
face=3D"Courier New" size=3D2>&nbsp;<A =
href=3D"http://www.wanyrobotics.com/"=20
target=3D_blank>http://www.wanyrobotics.com</A></FONT> <BR><FONT=20
face=3D"Courier New" =
size=3D2>----------------------------------------</FONT></FONT>=20
</P></DIV></FONT></FONT></SPAN></BODY></HTML>

------_=_NextPart_001_01C2E4B8.47149820--