Code: Select all
p = nodeEn->getPosition();
r = nodeEn->getRotation();
rot = ((atan(-(acZ-p.Z)/(acX-p.X)))*57.29)-75; // angle rotate
r.Y = rot;
nodeEn->setRotation(r);
p.X += cos((r.Y) * 3.14 / 180);
p.Z -= sin((r.Y) * 3.14 / 180);
nodeEn->setPosition(core::vector3df(p.X,17,p.Z));
Could you tell me what's wrong?
Thank you