Difference between revisions of "GetAngleZ - ObjectReference"

Jump to navigation Jump to search
m
→‎Notes: using syntax highlighting
imported>Dragoonwraith
(→‎Notes: porting from GetAngle)
imported>Dragoonwraith
m (→‎Notes: using syntax highlighting)
Line 25: Line 25:
* In the Tamriel worldspace, a Z angle of 0 is North, however, the same is not true of interiors (other exterior worldspaces have not been tested) — GetAngle is based on the game's coordinate system and the Compass is based on the NorthMarker object in each cell. Therefore, GetAngle Z is only useful for determining compass directions in the exterior Tamriel worldspace.
* In the Tamriel worldspace, a Z angle of 0 is North, however, the same is not true of interiors (other exterior worldspaces have not been tested) — GetAngle is based on the game's coordinate system and the Compass is based on the NorthMarker object in each cell. Therefore, GetAngle Z is only useful for determining compass directions in the exterior Tamriel worldspace.
* 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:
* 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
<source lang="papyrus">float GameAngleZ  ;the game's version
float TrigAngleZ ;the rest of the world's interpretation of the same
float TrigAngleZ ;the rest of the world's interpretation of the same
 
GameAngleZ = Game.GetPlayer().GetAngleZ()
GameAngleZ = Game.GetPlayer().GetAngleZ()
if ( GetAngleZ < 90 )
if ( GetAngleZ < 90 )
  TrigAngleZ = 90 - GameAngleZ
  TrigAngleZ = 90 - GameAngleZ
else
else
  TrigAngleZ = 450 - GameAngleZ
  TrigAngleZ = 450 - GameAngleZ
endif
endif</source>


== See Also ==
== See Also ==

Navigation menu