Difference between revisions of "GetAngle"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Entim
(revert)
imported>DragoonWraith
(Z angle is NOT dependent on the compass (old information incorrect), but on the in-game coordinate system.)
Line 9: Line 9:


'''Special Notes (relative to GetAngle called upon the player)'''
'''Special Notes (relative to GetAngle called upon the player)'''
*Z angle returns a value from 0 to 360 depending on the player's current heading. Z angle is measured with south as 0 and increasing clockwise. Therefore, for trig functions to work properly with this function, you must  use -''angle'' + 90
*Z angle returns a value from 0 to 360 depending on the player's current heading. Z angle is measured with the positive ''y''-axis as 0 and increasing clockwise from there. In the Tamriel worldspace, this 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.
*Trigonometry with the Z angle could be done using the following conversion formula:
float GetAngleZ  ;the game's version
float TrigAngleZ ;the rest of the world's interpretation of the same
set GetAngleZ to player.GetAngle Z
if ( GetAngleZ < 90 )
  set TrigAngle to 90 - GetAngleZ
else
  set TrigAngle to 450 - GetAngleZ
endif
*X angle returns a value (theorically) from -90 to 90.  The true in-game range is -89 to 89, with -89 if the player is looking above himself, and 89 if player is looking at his feet.
*X angle returns a value (theorically) from -90 to 90.  The true in-game range is -89 to 89, with -89 if the player is looking above himself, and 89 if player is looking at his feet.
*NOTE: You can rotate the camera when riding a horse without changing the actual direction the player's facing so GetAngle Z is kind of useless sometimes (like when using getLOS) if the player is on a horse.
*NOTE: You can rotate the camera when riding a horse without changing the actual direction the player's facing so GetAngle Z is kind of useless sometimes (like when using getLOS) if the player is on a horse.

Revision as of 13:49, 17 May 2007

Syntax:

GetAngle axis 

Example:

GetAngle Z 


Returns the current world rotation angle of the object on the selected axis (X, Y, or Z) in float.


Special Notes (relative to GetAngle called upon the player)

  • Z angle returns a value from 0 to 360 depending on the player's current heading. Z angle is measured with the positive y-axis as 0 and increasing clockwise from there. In the Tamriel worldspace, this 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.
  • Trigonometry with the Z angle could be done using the following conversion formula:
float GetAngleZ  ;the game's version
float TrigAngleZ ;the rest of the world's interpretation of the same

set GetAngleZ to player.GetAngle Z
if ( GetAngleZ < 90 )
  set TrigAngle to 90 - GetAngleZ
else
  set TrigAngle to 450 - GetAngleZ
endif
  • X angle returns a value (theorically) from -90 to 90. The true in-game range is -89 to 89, with -89 if the player is looking above himself, and 89 if player is looking at his feet.
  • NOTE: You can rotate the camera when riding a horse without changing the actual direction the player's facing so GetAngle Z is kind of useless sometimes (like when using getLOS) if the player is on a horse.