Vector3

An object in 3D space that have a position and rotation

Constructor

new Vector3()

Members

x :number

Type:
  • number

y :number

Type:
  • number

z :number

Type:
  • number

Methods

distance(other)

The distance between two Vector3 positions

Parameters:
NameTypeDescription
otherVector3
Returns:

number

set(xopt, yopt, zopt)

Changes the x, y, z components of this vector to the given values.

Parameters:
NameTypeAttributesDescription
xnumber | Vector3<optional>

The x coordinate or another Vector3.

ynumber<optional>

The y coordinate. Only used if 'x' and 'z' are also provided.

znumber<optional>

The z coordinate. Only used if 'x' and 'y' are also provided.