class Camera (client-side)
Available since version: 0.3.0
Static access to the active engine camera.
Properties
boolean modeChangeEnabled
Represents whether scripted camera mode changes are enabled.
boolean movementEnabled
Represents whether the camera is allowed to move. Setting this to true restores engine camera AI after manual position or rotation changes.
Vob|nil targetVob
Represents the active camera target Vob.
Methods
setMode
Sets the active camera mode.
boolean setMode(string mode)
Parameters:
stringmode: Camera mode name.
Returns boolean:
True if an AI camera is available.
getMode
Returns the active camera mode.
string getMode()
Returns string:
Camera mode name.
setPosition
Sets the active camera world position. This puts the camera into manual movement mode until movementEnabled is set to true.
void setPosition(number x, number y, number z)
Parameters:
numberx: X world position.numbery: Y world position.numberz: Z world position.
getPosition
Returns the active camera world position.
{x, y, z} getPosition()
Returns {x, y, z}:
Table containing x,y,z world position.
setRotationDegrees
Sets the active camera Euler rotation in degrees. This puts the camera into manual movement mode until movementEnabled is set to true.
void setRotationDegrees(number x, number y, number z)
Parameters:
numberx: X rotation in degrees.numbery: Y rotation in degrees.numberz: Z rotation in degrees.
getRotationDegrees
Returns the active camera Euler rotation in degrees.
{x, y, z} getRotationDegrees()
Returns {x, y, z}:
Table containing x,y,z rotation.
setTargetVob
Sets a Vob as the active camera target.
boolean setTargetVob(Vob vob)
Parameters:
Vobvob: Target Vob.
Returns boolean:
True if the target was applied.
setTargetPlayer
Sets a streamed player or server NPC as the active camera target. Local NPC ids are not supported.
boolean setTargetPlayer(number playerId)
Parameters:
numberplayerId: Streamed player or server NPC id; client-local NPC ids are not supported.
Returns boolean:
True if the player or NPC exists.
setFOV
Sets the active render camera field of view.
void setFOV(number fov)
Parameters:
numberfov: Field of view.
getFOV
Returns the active render camera field of view.
number getFOV()
Returns number:
Field of view.
Callbacks
No callbacks.