GetCameraMatrix

From Multi Theft Auto: Wiki

Jump to: navigation, search

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

Click to collapse [-]
Server

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 [-]
Client

OOP Syntax Help! I don't understand this!

Method: Camera.getMatrix(...)
Variable: .matrix
Counterpart: setCameraMatrix

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 [-]
Client
local x, y, z, lx, ly, lz = getCameraMatrix ()
x, lx = x + 1, lx + 1
 
setCameraMatrix (x, y, z, lx, ly, lz)

See Also

Personal tools