GetCameraMatrix: Difference between revisions
Jump to navigation
Jump to search
(Changed simple note in the text to an important note(Server-side this functions returns false or the latest value set by the server)) |
No edit summary |
||
Line 4: | Line 4: | ||
{{Important Note|Server-side this functions returns false or the latest value set | {{Important Note|Server-side this functions returns false or the latest value set via [[setCameraMatrix]] (called from server or client).}} | ||
==Syntax== | ==Syntax== | ||
<section name="Server" class="server" show="true"> | <section name="Server" class="server" show="true"> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
float float float float float float float float getCameraMatrix (player thePlayer) | float float float float float float float float getCameraMatrix ( player thePlayer ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[player]]:getCameraMatrix|cameraMatrix|setCameraMatrix}} | {{OOP||[[player]]:getCameraMatrix|cameraMatrix|setCameraMatrix}} |
Revision as of 14:19, 16 February 2019
This function gets the position of the camera and the position of the point it is facing.
Important Note: Server-side this functions returns false or the latest value set via setCameraMatrix (called from server or client). |
Syntax
Click to collapse [-]
Serverfloat float float float float float float float getCameraMatrix ( player thePlayer )
OOP Syntax Help! I don't understand this!
- Method: player:getCameraMatrix(...)
- Variable: .cameraMatrix
- Counterpart: setCameraMatrix
Required Arguments
- thePlayer: The player whose camera matrix is to be returned.
Click to collapse [-]
Clientfloat float float float float float float float getCameraMatrix ()
OOP Syntax Help! I don't understand this!
- Method: Camera.getMatrix(...)
- Variable: .matrix
- Counterpart: setCameraMatrix
Returns
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
Click to collapse [-]
Clientlocal x, y, z, lx, ly, lz = getCameraMatrix () x, lx = x + 1, lx + 1 setCameraMatrix (x, y, z, lx, ly, lz)