GetAngleZ - ObjectReference

Revision as of 00:01, 4 April 2021 by imported>Tania (→‎Notes: added conversion from skyrim ck wiki)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Member of: ObjectReference Script

Gets this object's rotation around the z axis.

SyntaxEdit

float Function GetAngleZ() native

ParametersEdit

None.

Return ValueEdit

This object's rotation around the z axis, in degrees.

ExamplesEdit

Debug.Trace("We are rotated " + GetAngleZ() + " degrees around the Z axis")

NotesEdit

  • 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:
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

See AlsoEdit