[ODE] Collision detection of rapidly moving objects

Aanand Narayanan.P.P aanand at milestoneindia.com
Mon Aug 26 19:01:01 2002


This is a multi-part message in MIME format.

------=_NextPart_000_0008_01C24D33.3C5269A0
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Hi
            Take a smaller world step size. This should take care of the
objects moving at higher speeds. Basically the world step size should be
chosen in such a way that it takes care of the highest speed object in
the game/app. The step size will vary between applications (like slow
moving RPG=92s can have higher step size than a racing game).
            The method of predicting the new position using a temporary
dWorldStep (for all the collision objects) is expensive  since it has to
evaluate and solve the constraint matrices (LCP). Ideally we could have
a fixed step size (found using trial and error) and execute dWorldStep
using this. Ofcourse you will need to divide your frame time by the step
size to find the number of times the dWorldstep should be called. For
applications which runs at higher frame rates, the frame time and the
chosen step size will be almost same and hence the number of times the
dWorldStep is called for each frame sim will be one. Also smaller step
size increases accuracy.=20
            I have found out a reasonable step size by trial and error
and it takes care of the =93missing-collision=94 problem (ofcourse I am =
not
using ODE for all the cases, majority of the physics/dynamics and
collision code is custom, but the technique works for all the dynamics
engine).
            Recovering from a missed collision has always been a
problem. Another method would be to use the velocity of the objects and
use the swept volume for collision or calc the new pos using the
velocity by euler integration and use that (ofcourse this method ignores
all the contact influence and assumes there is no large force applied
which will drastically alter the velocity).=20
=20
Hope this helps!
=20
=20
Cheers
Aanand Narayanan.P.P
=20
=20
-----Original Message-----
From: ode-admin@q12.org [mailto:ode-admin@q12.org] On Behalf Of Keshav
Sent: Monday, August 26, 2002 3:13 PM
To: ode@q12.org
Subject: [ODE] Collision detection of rapidly moving objects
=20
Hello,
=20
How can I retrieve or find out, where my dynamic object will be, i.e
it's position and orientation after a time step, without calling
"dWorldStep"?
=20
Why I'm asking the above question is, the documentation of ODE says, the
typical simulation code will look like this:
=20
Loop:
1.      Apply forces to the bodies as necessary.=20
2.      Adjust the joint parameters as necessary.=20
3.      Call collision detection.=20
4.      Create a contact joint for every collision point, and put it in
the contact joint group.=20
5.      Take a simulation step.=20
6.      Remove all joints in the contact joint group.=20
=20
I'm doing the collision detection on my own. I'm not using ODE's
collision detection.
Now, if 'm taking small time steps, and the objects really don't attain
high speeds, then, this is okay.
=20
Consider an example.
Say, a sphere with a radius (in 3D graphics units) of 1.0  is being
simulated.
Say there is a plane having a equation of (0, 1, 0, 0). i.e it is at the
origin, and facing upwards.
=20
Assume that the sphere is dropped from a certain height and is soon
approaching the ground plane.=20
Say, it's current position is (0, 2.2f, 0).
=20
If we match the proceedings to the simulation loop, we would get:
Step 3: Because the position is (0, 2.2f, 0), the collision detection
routine would return that there was no collision.
Step 4: No contact joints, because, there was no collision.
Step 5: Take a simulation step. Now, say, the time step was pretty large
due to some reason, and the sphere really accelerated fast.
               Say, it moved to position (0, -2.2f, 0), i.e it has moved
below the ground plane.
=20
Step 3: Because the position is (0, -2.2f, 0), the collision detection
routine would return that there was no collision.
Step 4: No contact joints, because, there was no collision.
Step 5: Take a simulation step. Now, the sphere has already gone through
the floor. There's no way to recover.
=20
One solution for the above problem is to check collision of the movement
vector.
=20
This is the reason, I need the "next position" and "next orientation" of
the moving object, w.r.t to time step.
Does ODE support it, or do I have to work around??
=20
How does ODE do it's collision detection for a moving object? Is it
w.r.t movement vectors or only with the objects position?
=20
----------
=20
I thought of one more method. Just let me know if it's correct.
Say, the previous position was (0, 3.5f, 0), and after "dWorldStep", the
sphere had moved to (0, 2.2f, 0)
=20
Step 3: Now, check the collision of the movement vector from (0, 3.5f,
0) to (0, 2.2f, 0).
              The collision detection routine would return that there
was no collision.
Step 4: No contact joints, because, there was no collision.
Step 5: Take a simulation step. Now, say, the time step was pretty large
due to some reason, and the sphere really accelerated fast.
               Say, it moved to position (0, -2.2f, 0), i.e it has moved
below the ground plane.
=20
Step 3: Now, check the collision of the movement vector from (0, 2.2f,
0) to (0, -2.2f, 0). Obviously, there will be a collision.
Step 4: Generate contact joints.
Step 5: Take a simulation step.=20
               Now, the collision will be resolved, and the sphere will
be above the plane, rather that going right through it.
=20
Is the above method feasible? Is it okay to do this?
=20
=20
- Keshav.

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002
=20

------=_NextPart_000_0008_01C24D33.3C5269A0
Content-Type: text/html;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DWindows-1252">


<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml@01C24D33.3BCC22A0">
<title>Message</title>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"place"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"time"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"date"/>
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:EnvelopeVis/>
 </w:WordDocument>
</xml><![endif]--><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:16792199 0 0 0 65791 0;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
span.EmailStyle18
	{mso-style-type:personal-reply;
	mso-style-noshow:yes;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:Arial;
	mso-ascii-font-family:Arial;
	mso-hansi-font-family:Arial;
	mso-bidi-font-family:Arial;
	color:navy;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:1278296733;
	mso-list-template-ids:-1674010018;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */=20
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple =
style=3D'tab-interval:.5in'>

<div class=3DSection1>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>Hi<o:p></o:p></span></font>=
</p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span>Take
a smaller world step size. This should take care of the objects moving =
at
higher speeds. Basically the world step size should be chosen in such a =
way
that it takes care of the highest speed object in the game/app. The step =
size
will vary between applications (like slow moving RPG=92s can have higher
step size than a racing game).<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span>The
method of predicting the new position using a temporary <span =
class=3DSpellE>dWorldStep</span>
(for all the collision objects) is <span class=3DGramE>expensive <span
style=3D'mso-spacerun:yes'>&nbsp;</span>since</span> it has to evaluate =
and solve
the constraint matrices (LCP). Ideally we could have a fixed step size =
(found
using trial and error) and execute <span =
class=3DSpellE>dWorldStep</span> using
this. <span class=3DSpellE>Ofcourse</span> you will need to divide your =
frame time
by the step size to find the number of times the <span =
class=3DSpellE>dWorldstep</span>
should be called. For <span class=3DGramE>applications which runs</span> =
at
higher frame rates, the frame time and the chosen step size will be =
almost same
and hence the number of times the <span class=3DSpellE>dWorldStep</span> =
is
called for each frame <span class=3DSpellE>sim</span> will be one. Also =
smaller
step size increases accuracy. <o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span>I
have found out a reasonable step size by trial and error and it takes =
care of the
=93missing-collision=94 problem (<span class=3DSpellE>ofcourse</span> I =
am
not using ODE for all the cases, majority of the physics/dynamics and =
collision
code is custom, but the technique works for <span class=3DGramE>all =
the</span>
dynamics engine).<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span>Recovering
from a missed collision has always been a problem. Another method would =
be to
use the velocity of the objects and use the swept volume for collision =
or calc
the new pos using the velocity by <span class=3DSpellE><span =
class=3DGramE>euler</span></span>
integration and use that (<span class=3DSpellE>ofcourse</span> this =
method
ignores all the contact influence and assumes there is no large force =
applied
which will drastically alter the velocity). =
<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><o:p>&nbsp;</o:p></span></f=
ont></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>Hope this =
helps!<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><o:p>&nbsp;</o:p></span></f=
ont></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><o:p>&nbsp;</o:p></span></f=
ont></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>Cheers<o:p></o:p></span></f=
ont></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>Aanand =
Narayanan.P.P<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><o:p>&nbsp;</o:p></span></f=
ont></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><o:p>&nbsp;</o:p></span></f=
ont></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original =
Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b> ode-admin@q12.org
[mailto:ode-admin@q12.org] <b><span style=3D'font-weight:bold'>On Behalf =
Of </span></b>Keshav<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> =
</span></font><st1:date
Month=3D"8" Day=3D"26" Year=3D"2002"><font size=3D2 face=3DTahoma><span =
style=3D'font-size:
 10.0pt;font-family:Tahoma'>Monday, August 26, =
2002</span></font></st1:date><font
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'> </span></font><st1:time
Hour=3D"15" Minute=3D"13"><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
 font-family:Tahoma'>3:13 PM</span></font></st1:time><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><br>
<b><span style=3D'font-weight:bold'>To:</span></b> ode@q12.org<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> [ODE] Collision =
detection
of rapidly moving objects</span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Hello,</span></font><o:p></o=
:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>How can I retrieve or find =
out,
where my dynamic object will be, i.e it's position and orientation after =
a time
step, without calling </span></font><strong><b><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>&quot;dWorldStep&quot;?</span></font></b></strong><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Why I'm asking the above =
question
is, the documentation of ODE says, the typical simulation code will look =
like
this:</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal =
style=3D'margin-left:.5in'><st1:place><strong><b><font size=3D2
 color=3Dblue face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
 =
mso-bidi-font-family:Arial;color:blue'>Loop</span></font></b></strong></s=
t1:place><strong><b><font
size=3D2 color=3Dblue face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:blue'>:</span></font></b></strong><o:p><=
/o:p></p>

</div>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 =
lfo1;tab-stops:list 1.0in'><![if !supportLists]><font
size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'><span
style=3D'mso-list:Ignore'>1.<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</span></font></span></span></font><![endif]><font
size=3D2 color=3Dblue face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;
color:blue'>Apply forces to the bodies as necessary. =
</span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 =
lfo1;tab-stops:list 1.0in'><![if !supportLists]><font
size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'><span
style=3D'mso-list:Ignore'>2.<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</span></font></span></span></font><![endif]><font
size=3D2 color=3Dblue face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;
color:blue'>Adjust the joint parameters as necessary. =
</span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 =
lfo1;tab-stops:list 1.0in'><![if !supportLists]><font
size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'><span
style=3D'mso-list:Ignore'>3.<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</span></font></span></span></font><![endif]><font
size=3D2 color=3Dblue face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;
color:blue'>Call collision detection. </span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 =
lfo1;tab-stops:list 1.0in'><![if !supportLists]><font
size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'><span
style=3D'mso-list:Ignore'>4.<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</span></font></span></span></font><![endif]><font
size=3D2 color=3Dblue face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;
color:blue'>Create a contact joint for every collision point, and put it =
in the
contact joint group. </span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 =
lfo1;tab-stops:list 1.0in'><![if !supportLists]><font
size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'><span
style=3D'mso-list:Ignore'>5.<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</span></font></span></span></font><![endif]><font
size=3D2 color=3Dblue face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;
color:blue'>Take a simulation step. </span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 =
lfo1;tab-stops:list 1.0in'><![if !supportLists]><font
size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'><span
style=3D'mso-list:Ignore'>6.<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</span></font></span></span></font><![endif]><font
size=3D2 color=3Dblue face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;
color:blue'>Remove all joints in the contact joint group. =
</span></font><o:p></o:p></p>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dblack face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;
color:black'>I'm doing the collision detection on my own. I'm not using =
ODE's
collision detection.</span></font></b></strong><font size=3D2 =
color=3Dblue
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;color:blue'><o:p></o:p></span=
></font></p>

</div>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Now, if 'm taking small =
time steps,
and the objects really don't attain high speeds, then, this is =
okay.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Consider an =
example.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Say, a sphere with a radius =
(in 3D
graphics units) of&nbsp;1.0&nbsp; is being =
simulated.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Say there is a plane having =
a
equation of (0, 1, 0, 0). i.e it is at the origin, and facing =
upwards.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Assume that the sphere is =
dropped
from a certain height and is soon approaching the ground plane. =
</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Say, it's current position =
is (0,
2.2f, 0).</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>If we match the proceedings =
to the
simulation loop, we would get:</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dmaroon face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:maroon'>Step =
3:</span></font></b></strong><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> Because the
position is (0, 2.2f, 0), the collision detection routine would return =
that
there was no collision.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dmaroon face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:maroon'>Step =
4:</span></font></b></strong><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> No contact
joints, because, there was no collision.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dmaroon face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:maroon'>Step =
5:</span></font></b></strong><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> Take a
simulation step. Now, say, the&nbsp;time step was pretty large due to =
some
reason,&nbsp;and the sphere really accelerated =
fast.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Say, it moved to position (0, -2.2f, 0), i.e it has moved below the =
ground
plane.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dmaroon face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:maroon'>Step =
3:</span></font></b></strong><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;Because
the position is (0, -2.2f, 0), the collision detection routine would =
return
that there was no collision.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dmaroon face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:maroon'>Step =
4:</span></font></b></strong><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> No contact
joints, because, there was no collision.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dmaroon face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:maroon'>Step =
5:</span></font></b></strong><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> Take a
simulation step. Now, the sphere has already gone through the floor. =
There's no
way to recover.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>One&nbsp;solution for the =
above
problem is to check collision of the movement =
vector.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>This is the reason, I need =
the
&quot;next position&quot; and &quot;next orientation&quot; of the moving
object, w.r.t to time step.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Does ODE support it, =
or&nbsp;do I
have to work around??</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>How does ODE do it's =
collision
detection for a moving object? Is it w.r.t movement vectors or only with =
the
objects position?</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>----------</span></font><o:p=
></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>I thought of one more =
method. Just
let me know if it's correct.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Say, the previous position =
was (0,
3.5f, 0), and after &quot;dWorldStep&quot;, the sphere had moved to (0, =
2.2f,
0)</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dmaroon face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:maroon'>Step =
3:</span></font></b></strong><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;Now,
check the collision of the movement vector from (0, 3.5f, 0) to (0, =
2.2f, 0).<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The
collision detection routine would return that there was no =
collision.<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dmaroon face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:maroon'>Step =
4:</span></font></b></strong><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> No contact
joints, because, there was no collision.<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dmaroon face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:maroon'>Step =
5:</span></font></b></strong><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> Take a
simulation step. Now, say, the&nbsp;time step was pretty large due to =
some
reason,&nbsp;and the sphere really accelerated =
fast.<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Say, it moved to position (0, -2.2f, 0), i.e it has moved below the =
ground
plane.<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;<o:p></o:p></span></fo=
nt></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dmaroon face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:maroon'>Step =
3:</span></font></b></strong><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;Now,
check the collision of the movement vector from (0, 2.2f, 0) to (0, =
-2.2f, 0).
Obviously, there will be a collision.<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dmaroon face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:maroon'>Step =
4:</span></font></b></strong><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;Generate
contact joints.<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><strong><b><font =
size=3D2
color=3Dmaroon face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial;color:maroon'>Step =
5:</span></font></b></strong><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> Take a
simulation step. <o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Now, the collision will be resolved, and the sphere will be above the =
plane,
rather that going right through it.<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;<o:p></o:p></span></fo=
nt></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Is the above method =
feasible? Is it
okay to do this?</span></font><o:p></o:p></p>

</div>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>- =
Keshav.</span></font><o:p></o:p></p>

</div>

</div>

</body>

</html>
<BR>

<P><FONT SIZE=3D2>---<BR>
Incoming mail is certified Virus Free.<BR>
Checked by AVG anti-virus system (http://www.grisoft.com).<BR>
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002<BR>
</FONT> </P><BR>

<P><FONT SIZE=3D2>---<BR>
Outgoing mail is certified Virus Free.<BR>
Checked by AVG anti-virus system (http://www.grisoft.com).<BR>
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002<BR>
</FONT> </P>

------=_NextPart_000_0008_01C24D33.3C5269A0--