Now there is such a code, it instantly turns the node to the point.
Code: Select all
void rotationToNode(IAnimatedMeshSceneNode *node, vector3df toNode, f32 speed)
{
vector3df nodePosition = node->getPosition();
vector3df rotationNeed;
float X = nodePosition.X - toNode.X;
float Y = nodePosition.Z - toNode.Z;
rotationNeed.Y = (f32)((atan2(X, Y) * 180 / PI) + 180);
node->setRotation(rotationNeed);
}