GetCameraMatrix: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
LordAzamath (talk | contribs) (Added an example) |
||
Line 28: | Line 28: | ||
==Example== | ==Example== | ||
'''Example 1:''' This clientside example moves camera +1 unit on X axis. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | local x, y, z, lx, ly, lz = getCameraMatrix() -- Get the current location and lookat of camera | ||
x, lx = x + 1, lx + 1 -- What will be the new x and x lookat values | |||
setCameraMatrix(x,y,z,lx,ly,lz) -- Set camera to new position | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Camera functions}} | {{Camera functions}} | ||
Revision as of 09:18, 26 March 2009
This function gets the position of the camera and the position of the point it is facing.
Note: The server-side version of this function returns the last camera matrix that was set by the server, and thus does not necessarily indicate the current matrix of the camera (since it may have been changed client-side).
Syntax
Click to collapse [-]
Serverfloat float float float float float getCameraMatrix ( player thePlayer )
Required Arguments
- thePlayer: The player whose camera matrix is to be returned.
Click to collapse [-]
Clientfloat float float float float float getCameraMatrix ( )
Required Arguments
None.
Returns
Returns six float numbers if the argument(s) are valid; the first three indicate the position of the camera, the last three indicate the position of the point it's facing. Returns false if the arguments are invalid.
Example
Example 1: This clientside example moves camera +1 unit on X axis.
local x, y, z, lx, ly, lz = getCameraMatrix() -- Get the current location and lookat of camera x, lx = x + 1, lx + 1 -- What will be the new x and x lookat values setCameraMatrix(x,y,z,lx,ly,lz) -- Set camera to new position
See Also
- fadeCamera
- getCameraInterior
- getCameraMatrix
- getCameraTarget
- setCameraInterior
- setCameraMatrix
- setCameraTarget