Not sure if this is a Farseer thing to do with inertia, or if it’s my code, but I’ve simplified the code quite a bit and I can’t find it.
Scenario: I’ve got a Body, with a Mass of 10(kg I assume). I use ApplyLinearImpulse and I scoot the object to the right using a vector like (1,0) and constant like 5.
Problem: It does move to the right, but it seems to be capped. The LinearVelocity property does go up as I increase the value fed to ApplyLinearImpulse, but the actual change in Position does not. As soon as I call world.step(msDelta), the LinearVelocity drops back to some tiny value.
Am I doing this wrong, or is there an internal cap based on my mass?
There is a maximum movement limit of 2.0 units per time step, set in the file b2Settings.h in the Box2D source code. You can change this value (b2_maxTranslation) if you need to, just be aware that the values in this file are tuned to work well together so you may get other problems if you change it too much.
Note that this is a #define’d constant used throughout Box2D so you’ll need to recompile the library itself to make the change take effect fully. I don’t know enough about Farseer to tell you whether this is easy or not 🙂
Generally if you feel the need to change this value you might like to first consider scaling all your physics dimensions down so that your bodies don’t need to move faster than 2 physics units per time step.
You might be interested in some other common ‘gotchas’ here: http://www.iforce2d.net/b2dtut/gotchas