Skip to content

static class Camera (client-side)

Available since version: 0.1.3

This class represents in game Camera.

Properties

bool modeChangeEnabled

Available since version: 0.1.3

Represents the camera mode change feature.
When mode change is enabled, game switches between different camera modes, e.g: when you draw weapon, camera mode will switch to "CAMMODMELEE".


string mode

Available since version: 0.1.10

Represents the camera mode, e.g: "CamModDive".
Camera mode describes the camera position from the player, rotation, and other properties..


bool movementEnabled

Available since version: 0.1.3

Represents the camera movement feature.
When movement is disabled, the camera gets detached from the player.


Methods

setMode

Deprecated since version: 0.1.10

This method will set the camera mode.

void setMode(string mode)

Parameters:

  • string mode: the camera mode.

getMode

Deprecated since version: 0.1.10

This method will get the camera mode.

string getMode()

Returns string:

the camera mode.


getPosition

Available since version: 0.1.3

This method will get the camera position.

{x, y, z} getPosition()

Returns {x, y, z}:

the camera position.


setPosition

Available since version: 0.1.3

This method will set the camera position.

void setPosition(float x, float y, float z)

Parameters:

  • float x: the position on x axis.
  • float y: the position on y axis.
  • float z: the position on z axis.

getRotation

Available since version: 0.1.3

This method will get the camera rotation.

{x, y, z} getRotation()

Returns {x, y, z}:

the camera rotation.


setRotation

Available since version: 0.1.3

This method will set the camera rotation.

void setRotation(float x, float y, float z)

Parameters:

  • float x: the rotation on x axis in deegres.
  • float y: the rotation on y axis in deegres.
  • float z: the rotation on z axis in deegres.

project

Available since version: 0.1.10

This method will convert point from 3d world space to screen coordinates (pixels).

{x, y} project()

Returns {x, y}:

screen coordinates represented as pixels. If projected point is behind camera, null is returned instead.


enableMovement

Deprecated since version: 0.1.10

This method will enable the movement for the camera.
When movement is disabled, the camera gets detached from the player.

void enableMovement(bool toggle)

Parameters:

  • bool toggle: false if you want to detach camera from player, otheriwse true.

setTargetVob

Available since version: 0.1.3

This method will set the target vob for the camera.

void setTargetVob(Vob vob)

Parameters:

  • Vob vob: the vob object reference.

setTargetPlayer

Available since version: 0.1.3

This method will set the target player for the camera.

void setTargetPlayer(int playerId)

Parameters:

  • int playerId: the id of the player.