Since the applyForce method takes a force vector in world space, I have to transform my original vector.
I tried simply rotating the vector like this:
Code: Select all
btQuaternion worldQuat(body_->getOrientation());
btVector3 rotaxis(worldQuat.getX(), worldQuat.getY(), worldQuat.getZ());
if(rotaxis.length() > 0)
rotaxis.normalize();
fvec = fvec.rotate(rotaxis, worldQuat.getW());
What is the right way of achieving the transform?