GetCameraMatrix: Difference between revisions
No edit summary |
(→Syntax: OOP syntax added) |
||
Line 37: | Line 37: | ||
==Object-oriented== | ==Object-oriented== | ||
<section name="Server" class="server" show="true"> | <section name="Server" class="server" show="true"> | ||
<syntaxhighlight lang="lua"> | |||
Matrix player:getCameraMatrix() | |||
--or | |||
Matrix player.cameraMatrix -- to get the camera matrix value | |||
player.cameraMatrix = Matrix -- to set the camera matrix value | |||
</syntaxhighlight> | |||
</section> | </section> | ||
Revision as of 05:44, 15 July 2014
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).
Procedural
float float float float float float float float getCameraMatrix (player thePlayer)
Required Arguments
- thePlayer: The player whose camera matrix is to be returned.
float float float float float float float float getCameraMatrix ()
This function returns 8 floats if the argument is valid (when applicable); the first three indicate the position of the camera, the next three indicate the position of the point it's facing, and the last two are the roll and field of view. Returns false if the argument is invalid.
Example
local x, y, z, lx, ly, lz = getCameraMatrix () x, lx = x + 1, lx + 1 setCameraMatrix (x, y, z, lx, ly, lz)
Object-oriented
Matrix player:getCameraMatrix() --or Matrix player.cameraMatrix -- to get the camera matrix value player.cameraMatrix = Matrix -- to set the camera matrix value
Matrix Camera.getMatrix ()
This function returns a matrix with the position of the camera (first three elements), the position of the point it's facing (next three elements) and the roll and field of view (last two elements) if the function is successful. Returns an empty matrix otherwise.
Example
This page lacks an example.
See Also
- fadeCamera
- getCameraInterior
- getCameraMatrix
- getCameraTarget
- setCameraInterior
- setCameraMatrix
- setCameraTarget