[ODE] ODE freezes, can you help?

Ivan Bolcina ivan.bolcina at volja.net
Mon Dec 16 14:34:03 2002


This is a multi-part message in MIME format.

------=_NextPart_000_0045_01C2A553.30831200
Content-Type: text/plain;
	charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

Hi. I create  "dJointCreateContact" by hand. Sometimes works just fine, =
sometimes it crashes application. Am I initializing structures wrongly? =
Or what??



dContact contact;        //contact
contact.surface.mode =3D dContactBounce; //bounce??
contact.surface.mu =3D 1;        // ???
contact.surface.bounce =3D 0.5f;    //????
contact.surface.bounce_vel =3D 0.1f;/????
convertVector(diff,contact.geom.normal);  // copy DirectX D3DXVECTOR3 to =
dVector3, normal
convertVector(m_Position-diff,contact.geom.pos);    //copy DirectX =
D3DXVECTOR3 to dVector3,position
D3DXVECTOR3 spe=3Dmove-tmp->move; //approximal depth calculation
len=3DD3DXVec3Length(&spe);
len*=3Dapp->getElapsedTime();
contact.geom.depth=3D5+len;
contact.geom.g1=3Dthis->PhyGeom;        // assign Geom of first body
contact.geom.g2=3Dtmp->PhyGeom;    //assign Geom of second body
dJointID c =3D dJointCreateContact =
(app->world,app->contactgroup,&contact);    // create join
dJointAttach (c,this->PhyBody,tmp->PhyBody);        // add it

------=_NextPart_000_0045_01C2A553.30831200
Content-Type: text/html;
	charset="iso-8859-2"
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-2">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV><FONT size=3D2>
<P>Hi. I create&nbsp; "dJointCreateContact" by hand. Sometimes works =
just fine,=20
sometimes it crashes application. Am I initializing structures wrongly? =
Or=20
what??</P>
<P>&nbsp;</P>
<P><FONT face=3D"Courier New">dContact contact;&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; //contact<BR></FONT><FONT=20
face=3D"Courier New">contact.surface.mode =3D dContactBounce;=20
//bounce??<BR></FONT></FONT><FONT size=3D2><FONT=20
face=3D"Courier New">contact.surface.mu =3D 1;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
// ???<BR></FONT><FONT face=3D"Courier New">contact.surface.bounce =3D=20
0.5f;&nbsp;&nbsp;&nbsp; //????<BR></FONT><FONT=20
face=3D"Courier New">contact.surface.bounce_vel =3D =
0.1f;/????<BR></FONT><FONT=20
face=3D"Courier New">convertVector(diff,contact.geom.normal);&nbsp; // =
copy=20
DirectX D3DXVECTOR3 to dVector3, normal<BR></FONT><FONT=20
face=3D"Courier =
New">convertVector(m_Position-diff,contact.geom.pos);&nbsp;&nbsp;&nbsp;=20
//copy DirectX D3DXVECTOR3 to dVector3,position<BR></FONT><FONT=20
face=3D"Courier New">D3DXVECTOR3 spe=3Dmove-tmp-&gt;move; //approximal =
depth=20
calculation<BR></FONT><FONT=20
face=3D"Courier New">len=3DD3DXVec3Length(&amp;spe);<BR></FONT><FONT=20
face=3D"Courier New">len*=3Dapp-&gt;getElapsedTime();<BR></FONT><FONT=20
face=3D"Courier New">contact.geom.depth=3D5+len;<BR></FONT><FONT=20
face=3D"Courier New">contact.geom.g1=3D</FONT></FONT><FONT =
face=3D"Courier New"=20
color=3D#0000ff size=3D2>this</FONT><FONT size=3D2><FONT=20
face=3D"Courier New">-&gt;PhyGeom;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
// assign=20
Geom of first body<BR></FONT><FONT=20
face=3D"Courier =
New">contact.geom.g2=3Dtmp-&gt;PhyGeom;&nbsp;&nbsp;&nbsp; //assign=20
Geom of second body<BR></FONT><FONT face=3D"Courier New">dJointID c =3D=20
dJointCreateContact=20
(app-&gt;world,app-&gt;contactgroup,&amp;contact);&nbsp;&nbsp;&nbsp; // =
create=20
join<BR></FONT><FONT face=3D"Courier New">dJointAttach =
(c,</FONT></FONT><FONT=20
face=3D"Courier New"><FONT color=3D#0000ff size=3D2>this</FONT><FONT=20
size=3D2>-&gt;PhyBody,tmp-&gt;PhyBody);&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; //=20
add it</P></FONT></FONT></DIV></DIV></BODY></HTML>

------=_NextPart_000_0045_01C2A553.30831200--