Hi:
i use Phy 2d Test ,i find bug .
demo is
Body body1 = new StaticBody("Ground1", new Box(400.0f, 20.0f));
body1.setPosition(250.0f, 400);
body1.setRestitution(1f);
world.add(body1);
Body faller = new Body("Faller", new Circle(25), 200.0f);
faller.setRestitution(1.0f);
faller.setPosition(280.0f, 100.0f);
world.add(faller);
I find then ball's velocity change
ball's Velocity'y:0.0
ball's Velocity'y:0.8333334
....................
ball's Velocity'y:71.66674
ball's Velocity'y:72.50006
ball's Velocity'y:-72.666725
....................
ball's Velocity'y:-0.16666426
we know ,when ball move down then max velocity is 72.50006, when collide the max velocity should be -72.50006. but in fact
,then ball's velocity is -72.666725.
so we can see then ball then collide with box,the max velocity should bigger.
i want make is ok. in then word.java's public void step(float dt)
i delete then b.adjustVelocity(temp)
and add then code
if (arbiters.size()==0 )
b.adjustVelocity(temp);
this 's is ball's Velocity'y:
ball's Velocity'y:0.0
ball's Velocity'y:0.8333334
..................
ball's Velocity'y:70.83342
ball's Velocity'y:71.66674
ball's Velocity'y:72.50006
ball's Velocity'y:-72.50006
ball's Velocity'y:-71.66674
...............
----------------------------------------------------------
in this demo that will be right ,but in other demo ,that will be wrong.
how to Judge is run b.adjustVelocity(temp) or not ?
can you send code for me or put on then
http://www.cokeandcode.com/phys2d/
Waiting for your reply.
my e-mail :XWGMakeGame27@163.com