SixL client API / common / Vector3Constructor

Interface: Vector3Constructor

The constructor mp.Vector3.

Example

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

Constructors

Constructor

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

Creates a vector from three numbers.

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

Array3d

The three components, in metres.

Returns

Vector3

Remarks

A missing element is undefined, not 0: pass all three.

Example

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

Constructor

new Vector3Constructor(components): Vector3

Creates a vector from anything with x, y and z.

Parameters

components

IVector3

A plain object or another vector, in metres.

Returns

Vector3

Remarks

A missing field is undefined, not 0: pass all three.

Example

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