Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Heading

Adam Wolfe
Registered User
Join date: 23 Dec 2004
Posts: 20
07-23-2005 02:49
Is there an easy way to get my objects current global heading..

So 0 = N, 90 = E, 180 = S, 270 = W ?
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
07-23-2005 03:28
This snippet does it (but won't compile as is obviously)

CODE
currRot=llGetRot();
currEuler=llRot2Euler(currRot);
zRotAngle=currEuler.z;//boat heading
compass=PI_BY_TWO-zRotAngle;
while (compass<0) compass+=TWO_PI;
compass=compass*RAD_TO_DEG;


I've unashamedly lifted it from Kanker's Flying Tako script which is out here