Difference between revisions of "GetAngleZ - ObjectReference"
Jump to navigation
Jump to search
imported>Jlundin m (GetAnglyZ - ObjectReference moved to GetAngleZ - ObjectReference: Typo fix) |
imported>Rasikko m (→Notes) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 14: | Line 14: | ||
== Return Value == | == Return Value == | ||
This object's rotation around the | This object's rotation around the Z axis, in degrees. Z angle is measured with the positive ''y''-axis as 0 and increasing clockwise from there. | ||
== Examples == | == Examples == | ||
Line 20: | Line 20: | ||
Debug.Trace("We are rotated " + GetAngleZ() + " degrees around the Z axis") | Debug.Trace("We are rotated " + GetAngleZ() + " degrees around the Z axis") | ||
</source> | </source> | ||
== Notes == | |||
* 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 addition to the above statement, if the cell doesn't contain a NorthMarker, the Compass will revert back to the coordinate system for that cell. | |||
* 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> | |||
== See Also == | == See Also == | ||
Line 27: | Line 42: | ||
*[[GetHeadingAngle - ObjectReference]] | *[[GetHeadingAngle - ObjectReference]] | ||
*[[SetAngle - ObjectReference]] | *[[SetAngle - ObjectReference]] | ||
*[[GetAngle]] Console Function |
Latest revision as of 10:43, 28 December 2017
Member of: ObjectReference Script
Gets this object's rotation around the z axis.
Syntax[edit | edit source]
float Function GetAngleZ() native
Parameters[edit | edit source]
None.
Return Value[edit | edit source]
This object's rotation around the Z axis, in degrees. Z angle is measured with the positive y-axis as 0 and increasing clockwise from there.
Examples[edit | edit source]
Debug.Trace("We are rotated " + GetAngleZ() + " degrees around the Z axis")
Notes[edit | edit source]
- 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 addition to the above statement, if the cell doesn't contain a NorthMarker, the Compass will revert back to the coordinate system for that cell.
- 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