I am trying to create a billiards/pool game, but am running into a problem with applying impulses to the spheres to simulate top spin. When I apply the impulse centrally (using applyCentralImpulse), there is no issue. Everything behaves as I would expect it to. When I use applyImpulse to simulate back-spin, using the following code, everything behaves as I would expect it to.
Code: Select all
btVector3 halfSize = boundingBox.getHalfSize();
rigidbody->applyImpulse(btVector3(_direction * _power), btVector3(0, -halfSize.y * 0.25f, 0));
Code: Select all
btVector3 halfSize = boundingBox().getHalfSize();
rigidbody->applyImpulse(btVector3(_direction * _power), btVector3(0, halfSize.y * 0.25f, 0));
Code: Select all
rigidBody->setFriction(0.9f);
rigidBody->setRestitution(0.9f);
rigidBody->setDamping(0.6f, 0.75f);
rigidBody->setContactProcessingThreshold(0);
rigidBody->setCcdMotionThreshold(0.000001f);
rigidBody->setCcdSweptSphereRadius(0.30f);
rigidBody->setActivationState(DISABLE_DEACTIVATION);