Bullet Physics: How to change body mass
We’ve run into a problem with updates of a mass of the body in our game Burnt Islands. We had some flying robots on the platforms of their factory. These robots were static objects in the beginning with no mass (mass = 0).
After the factory was destroyed the robots would have to fly up and begin to attack. In order to do that they got mass set so that static objects became dynamic. According to Bullet Physics specification it should work with just this code:
btVector3 inertia; body->getCollisionShape()->calculateLocalInertia( mass, inertia ); body->setMassProps(mass, inertia);
But that just didn’t work. Robots were “hanging” in the air. They wanted to attack, but couldn’t move.
pages: 1 2
- Bullet Physics
- Flash & Flex
- Game making
- Physics and Math
- Programming basics / Ugly code
Tagsanswers books boost bug bullet physics c++ c++11 check code collision detection Dev development example Fallout: New Vegas file format game Game review gentoo graphics howto html irrlicht Java linux math opengl people performance php physics programming questions quiz research sphere std template terrain test texture tip Visual Studio wordpress