favreau / bullet

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

Collision reaction with boxes is broken in 2.78 #523

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
OK so the summary is probably not correct, but that is what I'm seeing and I 
don't know how to better summarize it.

What steps will reproduce the problem?
1. Run the Hello World example from the Wiki 
(http://bulletphysics.org/mediawiki-1.5.8/index.php/Hello_World - 16.06.2011) 
(which is different from the Hello World example that comes with Bullet)
2. Replace the line
btCollisionShape* groundShape = new btStaticPlaneShape(btVector3(0,1,0),1);
with
btCollisionShape* groundShape = new btBoxShape(btVector3(10,1,10));
3. Run the example again

What is the expected output? What do you see instead?
The simulation should behave exactly the same in both cases. You are colliding 
with a flat surface of a static object at height 0. However if you use a 
btBoxShape the ball doesn't bounce once. It falls down and comes to rest 
instantly.
If you increase the restitution of both objects, (say to 0.9) the ball will 
bounce less often on the box than on the static plane. It is correct on the 
plane and incorrect on the box. (bouncing way too little for such a high 
restitution)

What version of the product are you using? On what operating system?
I'm using bullet 2.78 on Windows 7, building with Visual Studio 2010 32bit.
The simulation behaves correctly if I use bullet 2.77.

Please provide any additional information below.
The simulation behaves correctly in bullet 2.77.

Original issue reported on code.google.com by malteska...@gmail.com on 17 Jun 2011 at 7:05

GoogleCodeExporter commented 9 years ago
Contact generation for box versus plane is different from box versus box. This 
will result in different collision reaction. This is not a bug but expected 
behavior.

Original comment by erwin.coumans on 20 Jun 2011 at 4:03

GoogleCodeExporter commented 9 years ago
For box-plane there is only one contact point added per frame. FOr box versus 
box the contact generation adds 4 points each frame (contacts are always 
reduced to a maximum of 4)

Original comment by erwin.coumans on 20 Jun 2011 at 4:04

GoogleCodeExporter commented 9 years ago
But the difference is enormous. Slight differences between box and plane should 
be fine, but run the example with both object's restitution set to 0.9: The 
ball will bounce more than twice as high on the plane compared to the box.

Original comment by malteska...@gmail.com on 20 Jun 2011 at 4:13

GoogleCodeExporter commented 9 years ago
Can you check latest trunk? 

I reverted some change in Bullet 2.78 that broke restitution.

Original comment by erwin.coumans on 1 Sep 2011 at 2:17

GoogleCodeExporter commented 9 years ago
I don't see the problem anymore.
Fixed as far as I can tell.

Thanks

Original comment by malteska...@gmail.com on 7 Sep 2011 at 1:05

GoogleCodeExporter commented 9 years ago
Thanks for the report and testing!

Original comment by erwin.coumans on 15 Sep 2011 at 1:23