Mass doesn't affect Sphere fall speed

User avatar
pccsoares
Posts: 13
Joined: Mon Jan 20, 2014 11:57 am

Mass doesn't affect Sphere fall speed

Post by pccsoares »

I've been playing around with the HelloWorld example provided by the latest version of the library.
The demo has a ground plane and a sphere of a certain radius and mass that falls to the ground.

In the example, it has radius of 1.0 and mass of 1.0.
Gravity is set to (0, -10, 0)

Code: Select all

		btScalar mass(1.0f);

		btVector3 localInertia(0,0,0);
		colShape->calculateLocalInertia(mass,localInertia);

		btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform);
		btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,colShape,localInertia);
		btRigidBody * body = new btRigidBody(rbInfo);

		dynamicsWorld->addRigidBody(body);
If I change the mass to an higher value, the speed of the sphere falling is the exactly same. I can't see any differences between having mass of 1.0 or mass of 10.0.
Although if I modify the radius, I can see the speed changing.

Is this normal? Am I missing something?
billias13
Posts: 18
Joined: Thu Mar 22, 2012 9:29 am

Re: Mass doesn't affect Sphere fall speed

Post by billias13 »

Check this video, it explains why :P

http://www.youtube.com/watch?v=KDp1tiUsZw8
User avatar
pccsoares
Posts: 13
Joined: Mon Jan 20, 2014 11:57 am

Re: Mass doesn't affect Sphere fall speed

Post by pccsoares »

you mean there's something wrong with the gravity? It is set as I have seen everywhere in examples: (0, -10, 0)
how can I make it right?
billias13
Posts: 18
Joined: Thu Mar 22, 2012 9:29 am

Re: Mass doesn't affect Sphere fall speed

Post by billias13 »

I mean that since there are no other factors such us air resistance (size of object) etc, the rate on which any object falls towards the ground (acceleration of gravity and hence speed) is independent of its mass.
User avatar
pccsoares
Posts: 13
Joined: Mon Jan 20, 2014 11:57 am

Re: Mass doesn't affect Sphere fall speed

Post by pccsoares »

you are right! :)

From what I read, bullet doesn't implement air resistance.
Is there a way to simulate this on my sphere?
billias13
Posts: 18
Joined: Thu Mar 22, 2012 9:29 am

Re: Mass doesn't affect Sphere fall speed

Post by billias13 »

I am not quite sure whether or not you can implement air resistance in rigid bodies, but i think that for trivial shapes such as spheres and boxes etc it would be pretty much negligible. However, there is the option of setting slightly different gravity vectors for each falling object to achieve different speeds (scientifically inaccurate, but you can give it a try to see if it produces the effects that you want).
User avatar
pccsoares
Posts: 13
Joined: Mon Jan 20, 2014 11:57 am

Re: Mass doesn't affect Sphere fall speed

Post by pccsoares »

thanks.
billias13
Posts: 18
Joined: Thu Mar 22, 2012 9:29 am

Re: Mass doesn't affect Sphere fall speed

Post by billias13 »

Sorry, i forgot about damping! You can use this to implement any kind of resistance (linear or angular)
Check btRigidBody::setDamping
User avatar
pccsoares
Posts: 13
Joined: Mon Jan 20, 2014 11:57 am

Re: Mass doesn't affect Sphere fall speed

Post by pccsoares »

there is another thing that I'm not understanding. I changed restitution and friction values of my sphere, expecting it to bounce once it gets to the floor. For example:

Code: Select all

		body->setRestitution(0.8f);
		body->setFriction(0.5f);
And these are the results of the fall of my sphere with radius 1.0, in X, Y, Z:

Code: Select all

world pos = 2.000000,2.289296,0.000000
world pos = 2.000000,1.876760,0.000000
world pos = 2.000000,1.463891,0.000000
world pos = 2.000000,1.050691,0.000000
world pos = 2.000000,0.927432,0.000000
...
world pos = 2.000000,0.985486,0.000000
...
world pos = 2.000004,0.999999,0.000014
world pos = 2.000005,0.999999,0.000014
world pos = 2.000005,0.999999,0.000014
It looks like it falls to the ground, compresses and returns to it's initial form.
I was expecting to see a bounce above the floor.
Can you explain this?
User avatar
pccsoares
Posts: 13
Joined: Mon Jan 20, 2014 11:57 am

Re: Mass doesn't affect Sphere fall speed

Post by pccsoares »

figured it out.
both bodies (sphere and ground) need to have a restitution set. obviously.