I have this situation:
and I dont know how to get direction vector (marked on red). I need it to show Newton dynamics the direction in which the cannonball will fly.
Thanks for help
Code: Select all
x=1,y=0,z=0 => direction vector showing along +X-axis.
Code: Select all
vector3df dir = emptyNode->getAbsolutePosition() - meshNode->getAbsolutPosition();
dir.normalize();
Code: Select all
vector3df dir(1,0,0);
node->getAbsoluteTransformation().rotateVect(dir);