im doing a project using Bullet and Ogre.
I have advanced pretty much in using Bullet, but im having some trouble being able to have a tower made of btBoxShape stable.
To step the simulation, i do:
Code: Select all
if (fisicTimer.getMilliseconds() > 17){
dynamicsWorld->stepSimulation(fisicTimer.getMilliseconds()/1000.0f*velocidadSimulacion,10);
fisicTimer.reset();
}Code: Select all
fallShape = new btBoxShape(btVector3(1, 1, 1));Code: Select all
collShape->calculateLocalInertia(mass,inertia); //mass = 1
btRigidBody::btRigidBodyConstructionInfo fallRigidBodyCI(mass,motionState,collShape,inertia);
body = new btRigidBody(fallRigidBodyCI);
body->setFriction(friction); //friction = 0.9
body->setRestitution(restitution); //restitution = 0.3
body->setDamping(0.1, 0.1);
dynamicsWorld->addRigidBody(body);When I launch the simulation, the tower is like a little bouncy, and eventually it falls. If the blocks are made with btBoxShape(btVector3(10, 10, 10)) the tower stays stable, but i need to know why i cant use the previous size.
If you see something strange in the code, or have any idea of what could be making my simulation unstable, please, let me know. If you need any more information about my code, let me know.
Thanx