Rotating Velocity
Rotating Velocity
Hi, I have a vector for an object's velocity, for example <1.85,-2.24,1.59> and I want to make a function to rotate it for me so I can supply the velocity and the rotation to rotate it by so I could rotate the direction the object is moving along any given axis. I'm not the greatest with math and cannot find a solution for this on my own, so any help would be appreciated, thanks =D.
If I'm understanding what you're looking for, you just need to transform the velocity vector using the nodes transformation.
Travis
Code: Select all
// this is vector points 'forward' for any given object
core::vector3df forward(0.f, 0.f, 1.f);
// now forward is forward for node
node->getRelativeTransformation().rotateVect(forward);
// if you know node is a child of the root scene node, you could write
node->getAbsoluteTransformation().rotateVect(forward);