Local Co-ordinates for Scene Nodes
Local Co-ordinates for Scene Nodes
I've gone through the movement tutorial, but it only gives an example of moving using world co-ordinates or aataching an animator. Are there any functions for moving in local co-ordinates, ie up/down, left/right and sideways?
okay i'm not near any source code at the moment, but something like this is the basic idea-
core::matrix4 m;
core::vector3df direction = core::vector3df(1.0f,0,0); // moving right
m.setRotation(node->getRotation());
m.transformVector(direction);
node->setPosition(node->getPosition() + direction);
I think I remember someone doing a MoveForwards function, try searching for it
core::matrix4 m;
core::vector3df direction = core::vector3df(1.0f,0,0); // moving right
m.setRotation(node->getRotation());
m.transformVector(direction);
node->setPosition(node->getPosition() + direction);
I think I remember someone doing a MoveForwards function, try searching for it