GetHeadingAngle - ObjectReference: Difference between revisions

Jump to navigation Jump to search
m
Convert source tags to syntaxhighlight
imported>Egocarib
(Tried to tweak this to be a bit clearer, and added a visual aid.)
m (Convert source tags to syntaxhighlight)
 
Line 6: Line 6:


== Syntax ==
== Syntax ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
float Function GetHeadingAngle(ObjectReference akOther) native
float Function GetHeadingAngle(ObjectReference akOther) native
</source>
</syntaxhighlight>


== Parameters ==
== Parameters ==
Line 17: Line 17:


== Examples ==
== Examples ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
;Assume a view from above:
;Assume a view from above:
;
;
Line 35: Line 35:
float gAngle = A.GetHeadingAngle(C) ;gAngle will equal -90.0
float gAngle = A.GetHeadingAngle(C) ;gAngle will equal -90.0
float hAngle = A.GetHeadingAngle(D) ;hAngle will equal 150.0 (approx)
float hAngle = A.GetHeadingAngle(D) ;hAngle will equal 150.0 (approx)
</source>
</syntaxhighlight>




<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; Have the statue face the player
; Have the statue face the player
float zOffset = Statue.GetHeadingAngle(Game.GetPlayer())
float zOffset = Statue.GetHeadingAngle(Game.GetPlayer())
Statue.SetAngle(Statue.GetAngleX(), Statue.GetAngleY(), Statue.GetAngleZ() + zOffset)
Statue.SetAngle(Statue.GetAngleX(), Statue.GetAngleY(), Statue.GetAngleZ() + zOffset)
</source>
</syntaxhighlight>


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

Navigation menu