I seem to have stumbled onto an error with btVector3, the rotate() function in LinearMath/btVector3.h line 493. I've stumbled onto this while trying to apply a directional impulse at a particular point.
If I have a point (-2, -1, 0) which I want to rotate around an axis (eg. 0, 0, 1), there seems to be no effect (debugger shows that point doesn't change after calling rotate(). If I use an external vector library and rotate around the axis (0,0,1), I get valid results.
In effect, instead of doing the following (which doesn't work):
Code: Select all
btVector3 p1(-2, -1, 0);
p1.rotate(btVector3(0, 0, 1), z);
mRigidBody->applyImpulse(imp, p1);
Code: Select all
YVector3 p1(-2, -1, 0);
p1.Rotate(YVector3(0,0,1), z);
btVector3 p2(p1.x, p1.y, p1.z);
mRigidBody->applyImpulse(imp, p2);