<span class="Apple-style-span" style="font-size: small;">Thanks for the info. With backtracking I actually meant the computation of the exact collision time, and let (part of the simulation) only go that far, so it&#39;s not really &quot;back tracking&quot; in the physics engine; does that correspond to your 2nd proposal. I just got this from a <a href="http://www.amazon.com/Dynamic-Simulations-Multibody-Systems-Coutinho/dp/038795192X">physics book</a> that implements it that way (at least that why I got from reading it diagonally, the books contains a lot of advanced math...)</span><div>
<span class="Apple-style-span" style="font-size: small;"></span><div><div><div><div><span class="Apple-style-span" style="font-size: small;"><br></span></div><div><span class="Apple-style-span" style="font-size: small;">But do you mean that with your proposed methods the simulation will advance a full &quot;time step&quot; anyway, so the time interval does not need to broken up into smaller ones, where each sub-interval ends with a collision event? I wander how this could work since most of the time in a game when a collision happens, the game logic decides what forces to apply next, so the simulation can&#39;t really advance a full time step anyway (although that could be hacked I guess). Converting the game logic into differential equations with constraints seems very hard.</span></div>
<div><br></div><div><span class="Apple-style-span" style="font-size: small;">However, I must admit I haven&#39;t used any modern physics engines the last 5 years or so... But it&#39;s interesting to hear from people that did.<br>
</span></div><div><br></div><div><br></div><div><div><div><div><div><div><div><div class="gmail_quote"><span class="Apple-style-span" style="font-size: small;">On Fri, Mar 6, 2009 at 11:59 AM, jean-christophe mincke </span><span dir="ltr"><span class="Apple-style-span" style="font-size: small;">&lt;<a href="mailto:jeanchristophe.mincke@gmail.com">jeanchristophe.mincke@gmail.com</a>&gt;</span></span><span class="Apple-style-span" style="font-size: small;"> wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><span class="Apple-style-span" style="font-size: small;">Hello Peter,<br><br>The backtraking in time to solve the collision problem you mentionned is not, in my opinion, efficient.<br>
<br>From
a previous life as an aerospace engineer, I remember that two other
solutions exist to handle contact or collision constraints, at least if
2nd order diff. equations are used to describe the motion of a solid
with mass.<br><br>In any case, you have to use a  &#39;serious&#39; variable time step integration algorithm (I.E Runge-Kutta).<br><br>1.
The naive one: introduce a (virtual) spring between every 2 objets that
may collide.  When these objets get closer, the spring is compressed
and tries to push them back.<br>If the mass/velocity are high, that leads to a stiff system and the time steps may become very small.<br>However, this solution does not require any modification of the equations of motion.<br>
<br>2.
The serious one: modify or augment the equations of motion so that the
collision constraints are implicitly taken into account. If I remember
well, the magical trick is to use langrangian multipliers. <br>The difficult here (especially in the context of aFRP) is to derive the new equations.<br><br>Hope it helps<br><br>Regards<br><br>Jean-Christophe Mincke <br>
<br><br></span>



</div><div class="gmail_quote"><div class="im"><span class="Apple-style-span" style="font-size: small;">2009/3/6 Peter Verswyvelen </span><span dir="ltr"><span class="Apple-style-span" style="font-size: small;">&lt;</span><a href="mailto:bugfact@gmail.com" target="_blank"><span class="Apple-style-span" style="font-size: small;">bugfact@gmail.com</span></a><span class="Apple-style-span" style="font-size: small;">&gt;</span></span><span class="Apple-style-span" style="font-size: small;"><br>
</span></div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<span style=""><span class="Apple-style-span" style="font-size: small;">Regarding </span></span><span style="border-collapse:collapse;white-space:pre"><span style=""><span class="Apple-style-span" style="font-size: small;">hpysics, d</span></span></span><span style=""><span class="Apple-style-span" style="font-size: small;">id anybody did some experiments with this? The blog seems to be inactive since december 2008; has development ceased? </span></span><div>
<div></div><div class="h5"><div>

<span style=""><span class="Apple-style-span" style="font-size: small;"><br></span></span></div><div><span style=""><span class="Apple-style-span" style="font-size: small;">Do alternatives exist? Maybe good wrappers (hopefully pure...)  around existing engines?</span></span></div>

<div><span style=""><span class="Apple-style-span" style="font-size: small;"><br></span></span></div><div><div><div><div><div><span style=""><span class="Apple-style-span" style="font-size: small;">Integrating hpysics with Grapefruit might be a good topic for the Hackaton, trying to make a simple game (e.g. Pong or Breakout) without using recursive signal functions, but with correct collision response and better-than-Euler integration, all handled by the physics engine. Other FRP engines could be tried, but Grapefruit hacking is already a topic on the Hackaton, so it would combine efforts. </span></span></div>


<div><span style=""><span class="Apple-style-span" style="font-size: small;"><br></span></span></div><div><span style=""><span class="Apple-style-span" style="font-size: small;">It feels as if none of the current FRP engines can handle physics correctly, since a typical physics implementations requires &quot;time backtracking&quot;, in the sense that when you want to advance the current simulation time by a timestep, collision events can happen during that time interval, and hence the FRP engine can only advance time until the earliest collision event. So to do physics *with* an FRP engine, the implementation and maybe even semantics of the FRP system might need to be changed. *Using* a physics engine as a blackbox inside an FRP system might make more sense.</span></span></div>


<div><span style=""><span class="Apple-style-span" style="font-size: small;"><br></span></span></div><div><span style=""><span class="Apple-style-span" style="font-size: small;">Thanks to Wolfgang Jeltsch and Christopher Lane Hinson for having a discussion with me that lead to this.  Interestingly a similar discussion was help by other people in the Reactive mailing list at the same time :-)<br>
</span>

</span></div><div><span style=""><span class="Apple-style-span" style="font-size: small;"><br></span></span></div><div><span style=""><span class="Apple-style-span" style="font-size: small;">Cheers,</span></span></div><div>
<span style=""><span class="Apple-style-span" style="font-size: small;">Peter Verswyvelen</span></span></div>
<div><span style=""><span class="Apple-style-span" style="font-size: small;"><br></span></span></div><div><span style=""><span class="Apple-style-span" style="font-size: small;"><br></span></span></div><div><span style=""><span class="Apple-style-span" style="font-size: small;"><br>
</span>
</span></div><div><span style=""><span class="Apple-style-span" style="font-size: small;"><br></span></span></div><div><span class="Apple-style-span" style="font-size: small;"><br></span></div></div></div></div></div>
<span class="Apple-style-span" style="font-size: small;"><br></span></div></div><div class="im"><span class="Apple-style-span" style="font-size: small;">______________________________</span><span class="Apple-style-span" style="font-size: small;">_________________<br>

Reactive mailing list<br></span>
<a href="mailto:Reactive@haskell.org" target="_blank"><span class="Apple-style-span" style="font-size: small;">Reactive@haskell.org</span></a><span class="Apple-style-span" style="font-size: small;"><br></span>
<a href="http://www.haskell.org/mailman/listinfo/reactive" target="_blank"><span class="Apple-style-span" style="font-size: small;">http://www.haskell.org/</span><span class="Apple-style-span" style="font-size: small;">mailman/listinfo/reactive</span></a><span class="Apple-style-span" style="font-size: small;"><br>
<br></span>
</div></blockquote></div><span class="Apple-style-span" style="font-size: small;"><br></span>
</blockquote></div><br></div></div></div></div></div></div></div></div></div></div></div>