GetCameraRotation: Difference between revisions
Jump to navigation
Jump to search
m (Visual improvement) |
m (Fixed a typo) |
||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
{{Warning|'''This function no longer exists'''. However, below | {{Warning|'''This function no longer exists'''. However, below is a function that achieves a similar result.|true}} | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Revision as of 21:07, 4 May 2015
local function getCameraRotation ()
local px, py, pz, lx, ly, lz = getCameraMatrix()
local rotz = 6.2831853071796 - math.atan2 ( ( lx - px ), ( ly - py ) ) % 6.2831853071796
local rotx = math.atan2 ( lz - pz, getDistanceBetweenPoints2D ( lx, ly, px, py ) )
--Convert to degrees
rotx = math.deg(rotx)
rotz = -math.deg(rotz)
return rotx, 180, rotz
end
See Also
- fadeCamera
- getCameraInterior
- getCameraMatrix
- getCameraTarget
- setCameraInterior
- setCameraMatrix
- setCameraTarget