Difference between revisions of "GetAngle"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>PoHa!
imported>JT
m (+s, tweak to example script)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''Syntax:'''
{{Function
  GetAngle axis
  |CSWikiPage = GetAngle
'''Example:'''
|origin = GECK1
  GetAngle Z
  |summary = Returns the angle of the calling object relative to the world on the specified axis (X, Y, or Z).
 
|name = GetAngle
 
|returnType = float
Returns the current world rotation angle of the object on the selected axis (X, Y, or Z) in float.  
|referenceType = [Object]
 
|arguments =
  {{FunctionArgument
  |Name = Axis
  |Type = char
  |Value = X, Y, Z
  }}
|example = ActorRef.GetAngle Z
Player.GetAngle X
}}
== Notes ==
== Notes ==
*'''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 the positive ''y''-axis as 0 and increasing clockwise from there. In the Wasteland 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 Wasteland worldspace.
**'Player.GetAngle X' 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 that the player actually ''is'' looking 89 degrees above or below horizontal - you cannot look exactly up or exactly down in game.
**Trigonometry with the Z angle could be done using the following conversion formula:
**'Player.GetAngle' Z 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 Wasteland 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 Wasteland worldspace.
  float GetAngleZ  ;the game's version
**The angles returned are the common layman's understanding of angles, properly termed ''bearings''.  They increase clockwise, from 0 at the north to 90 in the east.  These are not the same as the standard mathematical/trigonometric "angles", which increase counterclockwise, from 0 at the east to 90 at the north. Trigonometry with the Z angle could be done using the following conversion formula:
  float TrigAngleZ ;the rest of the world's interpretation of the same
  float GetAngleZ  ;bearing
  float TrigAngleZ ;standard trigonometric angle
   
   
  set GetAngleZ to player.GetAngle Z
  set GetAngleZ to player.GetAngle Z
Line 20: Line 29:
   set TrigAngleZ to 450 - GetAngleZ
   set TrigAngleZ to 450 - GetAngleZ
  endif
  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 that the player actually ''is'' looking 89 degrees above or below horizontal - you cannot look exactly up or exactly down in game.
 
==See Also==
*[[GetHeadingAngle]]
*[[SetAngle]]
*[[Rotate]]
*[[GetPos]]
*[[SetPos]]
*[[MoveTo]]




[[Category:Functions]]
[[Category:Functions]]
[[Category:Functions (GECK 1.1)]]
[[Category:Movement Functions]]
[[Category:Movement Functions]]
[[Category:Movement Functions (GECK 1.1)]]
[[Category:Condition Functions]]
[[Category:Condition Functions]]
 
[[Category:Condition Functions (GECK 1.1)]]
<!-- Begin Search Terms
<!-- Begin Search Terms
  Get
  Get

Latest revision as of 15:22, 13 August 2010

< [[::Category:Functions|Category:Functions]]

Link to TES4 Construction Set Wiki: GetAngle.

A function included in the GECK version 1.1.0.36.

Description

Returns the angle of the calling object relative to the world on the specified axis (X, Y, or Z).

Syntax

[help]
(float) [Object].GetAngle Axis:char{X, Y, Z}

Example

ActorRef.GetAngle Z
Player.GetAngle X

Notes

  • Special Notes (relative to GetAngle called upon the player)
    • 'Player.GetAngle X' 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 that the player actually is looking 89 degrees above or below horizontal - you cannot look exactly up or exactly down in game.
    • 'Player.GetAngle' Z 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 Wasteland 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 Wasteland worldspace.
    • The angles returned are the common layman's understanding of angles, properly termed bearings. They increase clockwise, from 0 at the north to 90 in the east. These are not the same as the standard mathematical/trigonometric "angles", which increase counterclockwise, from 0 at the east to 90 at the north. Trigonometry with the Z angle could be done using the following conversion formula:
float GetAngleZ  ;bearing
float TrigAngleZ ;standard trigonometric angle

set GetAngleZ to player.GetAngle Z
if ( GetAngleZ < 90 )
  set TrigAngleZ to 90 - GetAngleZ
else
  set TrigAngleZ to 450 - GetAngleZ
endif

See Also