Difference between revisions of "GetAngleZ - ObjectReference"
m
→Notes: added conversion from skyrim ck wiki
imported>Plplecuyer m (GetAnglyZ - ObjectReference moved to GetAngleZ - ObjectReference: Typo fix) |
imported>Tania m (→Notes: added conversion from skyrim ck wiki) |
||
(One intermediate revision by the same user not shown) | |||
Line 19: | Line 19: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
Debug.Trace("We are rotated " + GetAngleZ() + " degrees around the Z axis") | Debug.Trace("We are rotated " + GetAngleZ() + " degrees around the Z axis") | ||
</source> | |||
== Notes == | |||
*Note that standard mathematical notation has 0 starting on the x-axis, rather than the y-axis, and increases counter-clockwise, not clockwise. Trigonometry (see Math Script) with the Z angle thus requires using the following conversion formula: | |||
<source lang="papyrus"> | |||
float GameAngleZ ;the game's version | |||
float TrigAngleZ ;the rest of the world's interpretation of the same | |||
GameAngleZ = Game.GetPlayer().GetAngleZ() | |||
if ( GameAngleZ < 90 ) | |||
TrigAngleZ = 90 - GameAngleZ | |||
else | |||
TrigAngleZ = 450 - GameAngleZ | |||
endif | |||
</source> | </source> | ||