Hello World Tutorial: sphere penetrating ground plane

Post Reply
karnivaurus
Posts: 9
Joined: Thu Nov 19, 2015 2:18 pm

Hello World Tutorial: sphere penetrating ground plane

Post by karnivaurus »

I have been following the Hello World tutorial (http://bulletphysics.org/mediawiki-1.5. ... ello_World) in which a sphere drops onto a static ground plane. To run this, I have simply copied and pasted the code in the tutorial, without making any changes.

Now, at the end of the tutorial, it notes that the sphere will actually appear to penetrate the ground slightly, and then bounce up, before coming to rest. However, when I run the code on my machine, it does penetrate the ground (the lowest point is 0.930), but then it tends towards 1.0, without ever overshooting. Therefore, the sphere never actually bounces. Why is the output different to that in the tutorial, when the code is exactly the same?

Also, the tutorial notes that if the frequency of the simulation steps is increased, then the penetration should be less. So, I tried "dynamicsWorld->stepSimulation(1 / 1000.f, 10, 1 / 1000.f);;". This time, the sphere did not penetrate the ground, however, it also did not bounce. It simply came to rest at height 1.0. Why did it not bounce?

Thanks!
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Hello World Tutorial: sphere penetrating ground plane

Post by drleviathan »

The problem is that the restitution of yourbtRigidBody's are zero, because the btRigidBody::btRigidBodyConstructionInfo struct's restitution defaults to zero.

The restitution represents how bouncy the object is. A value of 0.0 means "does not bounce at all" (zero energy is conserved at collision) and a value of 1.0 means "is very bouncy" (100% of energy is conserved at collision). That is how you're supposed to think about it however keep in mind that the effective restitution of a collision is actually the average of the two values involved.
Post Reply