Preventing contacts between connected bodies
Brett Hemes <[email protected]> Wed, 14 Nov 2007 12:16:48 -0600
| Newsgroups | gmane.comp.lib.ode |
|---|---|
| Message-ID | <[email protected]> |
--===============0665606069== Content-Type: multipart/alternative; boundary=Apple-Mail-9--138839578 --Apple-Mail-9--138839578 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Looking through the sample code I have noticed the following code in the nearCallbacks: dBodyID b1 = dGeomGetBody(o1); dBodyID b2 = dGeomGetBody(o2); if (b1 && b2 && dAreConnected(b1, b2)) return; and dBodyID b1 = dGeomGetBody(o1); dBodyID b2 = dGeomGetBody(o2); if (b1 && b2 && dAreConnectedExcluding (b1,b2,dJointTypeContact)) return; The benefit of the second is not completely clear to me. Also would it help to have a line: if(b1 == b2) return; for composite objects? Thanks, Brett --Apple-Mail-9--138839578 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 <HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; = -khtml-line-break: after-white-space; "><DIV>Looking through the sample = code I have noticed the following code in the = nearCallbacks:</DIV><DIV><BR class=3D"khtml-block-placeholder"></DIV><DIV = style=3D"text-indent: -24px;margin-top: 0px; margin-right: 0px; = margin-bottom: 0px; margin-left: 24px; "><FONT class=3D"Apple-style-span" = face=3D"Monaco" size=3D"2"><SPAN class=3D"Apple-style-span" = style=3D"font-size: 10px;">dBodyID b1 =3D = dGeomGetBody(o1);</SPAN></FONT></DIV><DIV style=3D"text-indent: = -24px;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = margin-left: 24px; "><FONT class=3D"Apple-style-span" face=3D"Monaco" = size=3D"2"><SPAN class=3D"Apple-style-span" style=3D"font-size: = 10px;">dBodyID b2 =3D dGeomGetBody(o2);</SPAN></FONT></DIV><DIV = style=3D"text-indent: -24px;margin-top: 0px; margin-right: 0px; = margin-bottom: 0px; margin-left: 24px; "><FONT class=3D"Apple-style-span" = face=3D"Monaco" size=3D"2"><SPAN class=3D"Apple-style-span" = style=3D"font-size: 10px;">if (b1 && b2 && = dAreConnected(b1, b2))=A0</SPAN></FONT></DIV><DIV style=3D"text-indent: = -24px;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = margin-left: 24px; "><FONT class=3D"Apple-style-span" face=3D"Monaco" = size=3D"2"><SPAN class=3D"Apple-style-span" style=3D"font-size: = 10px;"><SPAN class=3D"Apple-tab-span" style=3D"white-space:pre"> = </SPAN>return;</SPAN></FONT></DIV><DIV><BR = class=3D"khtml-block-placeholder"></DIV>and<DIV><BR = class=3D"khtml-block-placeholder"></DIV><DIV style=3D"text-indent: = -24px;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = margin-left: 24px; "><FONT class=3D"Apple-style-span" face=3D"Monaco" = size=3D"2"><SPAN class=3D"Apple-style-span" style=3D"font-size: = 10px;">dBodyID b1 =3D dGeomGetBody(o1);</SPAN></FONT><FONT = class=3D"Apple-style-span" face=3D"Monaco" size=3D"2"><SPAN = class=3D"Apple-style-span" style=3D"font-size: = 10px;"></SPAN></FONT></DIV><DIV style=3D"text-indent: -24px;margin-top: = 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 24px; "><FONT = class=3D"Apple-style-span" face=3D"Monaco" size=3D"2"><SPAN = class=3D"Apple-style-span" style=3D"font-size: 10px;">dBodyID b2 =3D = dGeomGetBody(o2);</SPAN></FONT></DIV><DIV style=3D"text-indent: = -24px;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = margin-left: 24px; "><FONT class=3D"Apple-style-span" face=3D"Monaco" = size=3D"2"><SPAN class=3D"Apple-style-span" style=3D"font-size: = 10px;">if (b1 && b2 && dAreConnectedExcluding = (b1,b2,dJointTypeContact))</SPAN></FONT></DIV><DIV style=3D"text-indent: = -24px;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = margin-left: 24px; "><FONT class=3D"Apple-style-span" face=3D"Monaco" = size=3D"2"><SPAN class=3D"Apple-style-span" style=3D"font-size: = 10px;"><SPAN class=3D"Apple-tab-span" style=3D"white-space:pre"> = </SPAN>return;</SPAN></FONT></DIV><DIV>=A0</DIV><DIV>The benefit of the = second is not completely clear to me.</DIV><DIV><BR = class=3D"khtml-block-placeholder"></DIV><DIV>Also would it help to have = a line:</DIV><DIV><BR class=3D"khtml-block-placeholder"></DIV><DIV>if(b1 = =3D=3D b2) return;</DIV><DIV><BR = class=3D"khtml-block-placeholder"></DIV><DIV>for composite = objects?</DIV><DIV><BR = class=3D"khtml-block-placeholder"></DIV><DIV>Thanks,</DIV><DIV>Brett</DIV>= <SPAN class=3D"Apple-style-span" style=3D"border-collapse: separate; = border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; = font-size: 12px; font-style: normal; font-variant: normal; font-weight: = normal; letter-spacing: normal; line-height: normal; text-align: auto; = -khtml-text-decorations-in-effect: none; text-indent: 0px; = -apple-text-size-adjust: auto; text-transform: none; orphans: 2; = white-space: normal; widows: 2; word-spacing: 0px; "><DIV><BR = class=3D"khtml-block-placeholder"></DIV><DIV><BR = class=3D"khtml-block-placeholder"></DIV><BR = class=3D"Apple-interchange-newline"></SPAN> <BR></BODY></HTML>= --Apple-Mail-9--138839578-- --===============0665606069== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ODE mailing list [email protected] http://ode.org/mailman/listinfo/ode --===============0665606069==--