CFCC / nettyboo

Automatically exported from code.google.com/p/nettyboo
0 stars 0 forks source link

Gravity balls speed up other balls without following energy conservation laws #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create gravity ball
2. Create other balls
3. Leave running for 10-20 minutes

Result: the ball is moving faster than it was before. 

Original issue reported on code.google.com by keithl on 30 Nov 2007 at 5:29

GoogleCodeExporter commented 9 years ago

Original comment by keithl on 30 Nov 2007 at 5:34

GoogleCodeExporter commented 9 years ago
I think this bay be because of wall bouncing.

Possible scenario:

Before 'turn':
--------------
  G  
    Y

After 'turn':
-------------
   Y
  G

Setup: G ball (gravity) is moving down (away from wall) and Y ball (text) is 
moving
into wall.

When a ball bounces it is 'teleported' to the new location and its velocity is
inverted, bypassing any intermediated locations where it may have had the 
chance to
obey conservation. For example, without the wall, after the Y ball passes the G 
ball,
it would start slowing down. But with the wall, the velocity is inverted and 
instead
of slowing down it is speed up.

I think this may explain the cause, but it should also (i would guess) effect 
it in
the opposite fashion. Maybe the nature of this bug (the wall) favors speedups.

Original comment by cosmo...@gmail.com on 30 Nov 2007 at 5:43