<div dir="ltr">Just to clarify some of these issues (I maintain JBox2d, so I know a lot about Box2d) - two balls that hit each other will react differently depending upon their coefficients of restitution.&nbsp; In Box2d, the default restitution is 0.0, since that&#39;s most often closest to what you want for game objects.&nbsp; That&#39;s likely why things are just moving together, the collision is completely inelastic.&nbsp; If you turn the restitution up to 1.0, things should work better.<br>
<br>With the Newton&#39;s cradle thing, the problem is that the while restitution works perfectly for two balls, when you have a chain of objects that are all touching, the solver treats it as a single islands of contacts and solves it &quot;together&quot; - this does result in a valid solution to all of the equations of motion.&nbsp; Unfortunately the equations of motion don&#39;t uniquely specify the result of Newton&#39;s cradle, and we end up with the &quot;wrong&quot; correct solution for this case - if we solved things &quot;correctly&quot; for this case, though, we&#39;d end up with bad results for other cases which are somewhat more common (an object pinned on both sides by another one is one that comes to mind), so it&#39;s a tough choice.&nbsp; In real life the degeneracy is removed by lots of additional microscopic variables that we don&#39;t account for in a physics engine, alas.&nbsp; Another way to think about it is that what breaks that degeneracy happens on a time scale a lot smaller than one time step, so in practice we always have to choose one way to break it every time, since we don&#39;t have the ability to simulate on such a fine scale.<br>
<br>Sometimes leaving some space between the balls can help, as can making the string holding them a bit longer and/or turning on the &quot;bullet&quot; flag for each of the balls (which handles each collision with continuous collision detection, thus taking care of the impulse ordering and avoiding the island solve), but I still haven&#39;t seen any generally useful methods that can keep Newton&#39;s cradle swinging properly for a very long time...<br>
<br>- Eric<br><br><div class="gmail_quote">On Tue, Jul 15, 2008 at 7:09 PM, Yoshiki Ohshima &lt;<a href="mailto:yoshiki@vpri.org">yoshiki@vpri.org</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">&gt; &gt; &nbsp;Heh, of course you can try by yourself.<br>
&gt;<br>
&gt; I want to know what happens in your code. Can you send it to me?<br>
<br>
</div> &nbsp;There is no code, and I don&#39;t know how to send anything. &nbsp;I just<br>
played around it on XO, and took photos but it couldn&#39;t same data into<br>
Journal.<br>
<div class="Ih2E3d"><br>
&gt; &gt; the floor (stand still), and make another hit from the side, the<br>
&gt; &gt; momentum is shared by these two circles and both of them move together<br>
&gt; &gt; at the same speed.<br>
&gt;<br>
&gt; That&#39;s unphysical, and I would only program that way in a fantasy<br>
&gt; setting. In a head-on elastic collision of two circles of equal mass,<br>
&gt; the hitter should stop dead, transferring all of its energy and<br>
&gt; momentum to the one it hit. As any pool payer knows for the case of<br>
&gt; spheres. In a Newton&#39;s cradle the momentum and energy passes from ball<br>
&gt; to ball at the speed of sound in the material of the balls.<br>
<br>
</div> &nbsp;If the ball is made of silly putty, something like this can happen,<br>
and as others pointed out (and in my second email mentions it), it is<br>
just wrong elasticity given to the circles.<br>
<div class="Ih2E3d"><br>
&gt; &gt;&gt; Have you tried two pendula hanging from a horizontal string? Do you<br>
&gt; &gt;&gt; get the expected transfer of energy back and forth?<br>
&gt; &gt;<br>
&gt; &gt; &nbsp;Yes, but no. &nbsp;I&#39;m not sure what you mean by a horizontal string, but<br>
&gt; &gt; the string I made is not flexible enough to make it happen.<br>
&gt;<br>
&gt; Tie a string between two points at the same height.<br>
&gt;<br>
&gt; Then tie a pendulum to the string.<br>
&gt;<br>
&gt; Then tie another pendulum of the same length and mass to a different<br>
&gt; point on the string.<br>
&gt;<br>
&gt; &nbsp; &nbsp;\____/<br>
&gt; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; |<br>
&gt; &nbsp; &nbsp;o &nbsp; &nbsp; &nbsp;o<br>
&gt;<br>
&gt; Start one pendulum in the direction perpendicular to the plane of the<br>
&gt; diagram. It will gradually transfer energy and momentum to the other<br>
&gt; almost completely, and then start up again while the other slows down<br>
&gt; and stops, and so on.<br>
<br>
</div> &nbsp;Edward... I know what it is. &nbsp;I&#39;m just saying that there is no<br>
&quot;string&quot;, it isn&#39;t trivial to make the same length or size of<br>
something more than one, nor there is no perpendicular plane in<br>
&quot;Physics&quot; (yet).<br>
<font color="#888888"><br>
-- Yoshiki<br>
</font><div><div></div><div class="Wj3C7c">_______________________________________________<br>
Games mailing list<br>
<a href="mailto:Games@lists.laptop.org">Games@lists.laptop.org</a><br>
<a href="http://lists.laptop.org/listinfo/games" target="_blank">http://lists.laptop.org/listinfo/games</a><br>
</div></div></blockquote></div><br></div>