like camera setTarget()
how?
how to make my node face another? (rotation)
here's how i done it in my project:
in this example monster's node is looking in the player's direction.
hope it helps!
Code: Select all
core::vector3df ourPosition = _monster->getPosition();
core::vector3df playerPosition = player->getPosition();
core::vector3df direction = ourPosition - playerPosition;
core::vector3df newRotation = direction.getHorizontalAngle() + core::vector3df( 0, 90, 0 );
_monster->setRotation( newRotation );
hope it helps!