SixL server API / common / Vector3Constructor

Interface: Vector3Constructor

The constructor mp.Vector3.

Constructors

Constructor

new Vector3Constructor(x?, y?, z?): Vector3

Creates a vector.

Parameters

x?

number

East-west, metres (default 0).

y?

number

North-south, metres (default 0).

z?

number

Height, metres (default 0).

Returns

Vector3

Example

const pos = new mp.Vector3(100, 200, 30);

Constructor

new Vector3Constructor(components): Vector3

Creates a vector from [x, y, z].

Parameters

components

number[]

The three components (a missing one is 0).

Returns

Vector3

Example

const pos = new mp.Vector3([100, 200, 30]);

Constructor

new Vector3Constructor(components): Vector3

Creates a vector from anything with x, y, z (a missing one is 0).

Parameters

components

IVector3

A plain object or another vector.

Returns

Vector3

Example

const pos = new mp.Vector3({ x: 100, y: 200, z: 30 });