Da die Frage nach so einer Funktion öfters mal zu lesen ist und das Forum hier noch leer ist, hab ich mir mal gedacht ich poste die hier:
Code:
void roateNodeTowardsTarget(scene::ISceneNode* node, core::vector3df target)
{
if(!node)
return;
core::vector3df direction = target - node->getAbsolutePosition();
node->setRotation(direction.getHorizontalAngle());
}
_________________
Phenom X4 9950 BE | 6144MB DDR2-800 | GeForce 8800GT 512MB | Asus M3A32-MVP Deluxe | 2TB HDD | 520W Seasonic NT | Soprano Tower | Samsung 22" TFT + Fujitsu-Siemens 17" TFT + Toshiba 42" FullHD LCD | Windows 7 Proessional x64
Behind the Brain