Falling object in Box2D should rotate due to centre of mass?
-
05-07-2019 - |
Question
I'm trying to simulate a falling balloon in Box2DAS3. What is important is that balloon falls the such that the bottom part were you blow it up rotates towards the bottom if it's knock sideways or is dropped at an angle.
alt text http://lh4.ggpht.com/_gjsCWAV_CZc/Sw7zqHahTJI/AAAAAAAAC3s/YIJka4AsM5s/s144/Untitled.jpg
I've tried offsetting the center of mass of the body and also joining two bodies together with the denser one representing the tie. In both cases the body falls at the same angle without rotating.
Solution
An object in free fall (vacuum), without any initial linear or angular velocity, will never start to spin by itself, no matter where its center of gravity lies. You need to simulate fluid drag and buoyancy. A simple way to this is to add a small force on the top of the balloon that points upwards.
OTHER TIPS
Add a drag force to all objects. Something like -velocity / drag_amount