What do you really want to do?
Do you want the ball to literally track a circular path around a known center? or do you want to be able to turn the ball around a corner and just assume it would follow something like a circular arc when doing so?
Assuming you just want to steer the ball around I would suggest doing something like this every substep:
Code: Select all
// compute delta velocity in world-frame
btVector3 deltaLinearVelocity = desiredLinearVelocity - currentLinearVelocity;
// try to effect velocity change if it is big enough
if (deltaLinearVelocity.length2() > someThresholdSquared) {
// compute force that will result in the velocity change
btVector3 force = (body->getMass() / subStepDuration) * deltaLinearVelocity;
// apply force
body->applyCentralForce(force);
// always activate body when applying force, else the force accumulates and is all applied at once when it does activate
if (!body->isActive()) {
body->activate(true);
}
}