[Box2D] Inertia

This topic contains 4 replies, has 3 voices, and was last updated by  MandarX 2 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
Author Posts
Author Posts
February 3, 2012 at 9:57 pm #238943

MandarX
Participant
@mandarx

Hello,

still learning Box2D :)

Does the inertia of a body depend upon velocity and friction?

is there a way to handle it?

thanks

MandarX

February 3, 2012 at 11:19 pm #364450

slembcke
Administrator
@slembcke

Not quite sure what you are asking.

Inertia is the measure of how hard it is to make something start or stop moving, and is basically the same thing as mass. Forces cause objects to speed up or slow down, and the amount of acceleration is inversely proportional to the mass (force = mass*acceleration or acceleration = force/mass). Friction is a force that slows things down, but a 2 kg object sliding across the floor will have twice the amount of friction as a 1 kg object and so the deceleration will be the same. The force of friction is also controlled by how slippery a surface is, but that has nothing to do with mass.

Does that clear anything up?

FYI: There is also the moment of inertia which is like mass/inertia, but applied to how hard it is to cause an object to rotate.

February 4, 2012 at 9:57 am #364451

MandarX
Participant
@mandarx

I try again:

does Box2D provide some control over inerta?

MandarX

February 4, 2012 at 10:51 am #364452

Nexus6
Participant
@nexus6

Are you looking for the linearDamping?

body->SetLinearDamping(0.5f);

From Box2d manual:

Damping is used to reduce the world velocity of bodies. Damping is different than friction because friction only occurs with contact. Damping is not a replacement for friction and the two effects should be used together.

Damping parameters should be between 0 and infinity, with 0 meaning no damping, and infinity meaning full damping. Normally you will use a damping value between 0 and 0.1. I generally do not use linear damping because it makes bodies look floaty.

Damping is approximated for stability and performance. At small damping values the damping effect is mostly independent of the time step. At larger damping values, the damping effect will vary with the time step. This is not an issue if you use a fixed time step (recommended).

February 5, 2012 at 11:59 am #364453

MandarX
Participant
@mandarx

Thanks

I think it can help

MandarX

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.