Vector3
Defined in: client/api.d.ts:1437
Mutable three-dimensional vector exposed as Core.Vector3 for positions, directions, and Euler angles.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Vector3(
x,y,z):Vector3
Defined in: client/api.d.ts:1444
Creates a vector from three numeric components.
Parameters
Section titled “Parameters”number
Initial X component.
number
Initial Y component.
number
Initial Z component.
Returns
Section titled “Returns”Vector3
Methods
Section titled “Methods”add(
other):this
Defined in: client/api.d.ts:1476
Adds another vector to this vector in place.
Parameters
Section titled “Parameters”Vector3
Vector to add component-wise.
Returns
Section titled “Returns”this
This mutated vector for chaining.
clone()
Section titled “clone()”clone():
Vector3
Defined in: client/api.d.ts:1547
Creates an independent copy of this vector.
Returns
Section titled “Returns”Vector3
New vector with the same components.
cross()
Section titled “cross()”cross(
other):this
Defined in: client/api.d.ts:1511
Replaces this vector with its cross product against another vector.
Parameters
Section titled “Parameters”Vector3
Second vector in the cross product.
Returns
Section titled “Returns”this
This mutated perpendicular vector for chaining.
distance()
Section titled “distance()”distance(
other):number
Defined in: client/api.d.ts:1541
Computes Euclidean distance to another vector.
Parameters
Section titled “Parameters”Vector3
Vector to measure from this vector.
Returns
Section titled “Returns”number
Distance between the two vectors.
div(
scalar):this
Defined in: client/api.d.ts:1497
Divides this vector by a scalar in place.
Parameters
Section titled “Parameters”scalar
Section titled “scalar”number
Divisor applied to every component; must be non-zero.
Returns
Section titled “Returns”this
This mutated vector for chaining.
dot(
other):number
Defined in: client/api.d.ts:1504
Computes the dot product without changing either vector.
Parameters
Section titled “Parameters”Vector3
Vector used for the dot product.
Returns
Section titled “Returns”number
Scalar dot product.
lerp()
Section titled “lerp()”lerp(
target,t):this
Defined in: client/api.d.ts:1525
Linearly interpolates this vector toward a target in place.
Parameters
Section titled “Parameters”target
Section titled “target”Vector3
Destination vector.
number
Interpolation factor; 0 keeps the current value and 1 reaches target.
Returns
Section titled “Returns”this
This mutated vector for chaining.
mul(
scalar):this
Defined in: client/api.d.ts:1490
Multiplies this vector by a scalar in place.
Parameters
Section titled “Parameters”scalar
Section titled “scalar”number
Multiplier applied to every component.
Returns
Section titled “Returns”this
This mutated vector for chaining.
normalize()
Section titled “normalize()”normalize():
this
Defined in: client/api.d.ts:1517
Normalizes this vector in place; a zero vector remains unchanged.
Returns
Section titled “Returns”this
This mutated vector for chaining.
set(
x,y,z):this
Defined in: client/api.d.ts:1534
Replaces all components in place.
Parameters
Section titled “Parameters”number
Replacement X component.
number
Replacement Y component.
number
Replacement Z component.
Returns
Section titled “Returns”this
This mutated vector for chaining.
sub(
other):this
Defined in: client/api.d.ts:1483
Subtracts another vector from this vector in place.
Parameters
Section titled “Parameters”Vector3
Vector to subtract component-wise.
Returns
Section titled “Returns”this
This mutated vector for chaining.
toJSON()
Section titled “toJSON()”toJSON():
object
Defined in: client/api.d.ts:1559
Converts this vector to a plain object for JSON.stringify.
Returns
Section titled “Returns”object
Object containing the current components.
x:
number
y:
number
z:
number
toString()
Section titled “toString()”toString():
string
Defined in: client/api.d.ts:1553
Formats this vector for logging and debugging.
Returns
Section titled “Returns”string
Text in Vector3(x, y, z) form.
forward()
Section titled “forward()”
staticforward():Vector3
Defined in: client/api.d.ts:1583
Creates the framework’s positive-Z unit direction.
Returns
Section titled “Returns”Vector3
New Vector3(0, 0, 1).
staticone():Vector3
Defined in: client/api.d.ts:1571
Creates a vector whose components are one.
Returns
Section titled “Returns”Vector3
New Vector3(1, 1, 1).
right()
Section titled “right()”
staticright():Vector3
Defined in: client/api.d.ts:1589
Creates the framework’s positive-X unit direction.
Returns
Section titled “Returns”Vector3
New Vector3(1, 0, 0).
staticup():Vector3
Defined in: client/api.d.ts:1577
Creates the framework’s positive-Y unit direction.
Returns
Section titled “Returns”Vector3
New Vector3(0, 1, 0).
zero()
Section titled “zero()”
staticzero():Vector3
Defined in: client/api.d.ts:1565
Creates a zero vector.
Returns
Section titled “Returns”Vector3
New Vector3(0, 0, 0).
Properties
Section titled “Properties”length
Section titled “length”
readonlylength:number
Defined in: client/api.d.ts:1464
Read-only Euclidean magnitude of this vector.
lengthSquared
Section titled “lengthSquared”
readonlylengthSquared:number
Defined in: client/api.d.ts:1469
Read-only squared magnitude, avoiding a square-root calculation.
x:
number
Defined in: client/api.d.ts:1449
Mutable X component.
y:
number
Defined in: client/api.d.ts:1454
Mutable Y component.
z:
number
Defined in: client/api.d.ts:1459
Mutable Z component.
