CameraClient

getCamRot

GET_CAM_ROT0x7D304C1C955E3E12

The GTA V native GET_CAM_ROT of the CAM namespace, as LS:MP client scripts call it: the global function getCamRot, in JavaScript and in Lua.

SignatureJavaScript
getCamRot(
  cam: Cam,
  rotationOrder: number
): { x: number, y: number, z: number }
SignatureLua
getCamRot(cam: Cam, rotationOrder: integer): Vector3

Usage

JavaScript
const { x, y, z } = getCamRot(cam, rotationOrder);
Lua
local coords = getCamRot(cam, rotationOrder)
-- coords.x, coords.y, coords.z

Parameters

ParameterTypeJavaScriptLua
camCamnumberinteger
rotationOrderintnumberinteger

Returns

Vector3 JavaScript { x: number, y: number, z: number }, Lua Vector3

A 3D vector. JavaScript gets a plain { x, y, z } object; Lua gets a real Vector3, with .x .y .z and arithmetic. As an argument, one vector fills three consecutive coordinates.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

The last parameter, as in other "ROT" methods, is usually 2.

Reference

Namespace
Camera CAM
In the game
Vector3 GET_CAM_ROT(Cam cam, int rotationOrder)
Hash
0x7D304C1C955E3E12

Open in the interactive natives reference