Vector3
Summary
Properties
Properties of a `Vector3`.Constants
Constants of a `Vector3`.Properties
X
NumberThe X-axis component of the vector.
Y
NumberThe Y-axis component of the vector.
Z
NumberThe Z-axis component of the vector.
Magnitude
NumberThe magnitude (aka. length) of the vector.
Unit
Vector3The normalized vector.
Constants
zero
Vector3
Vector3.zeroThe vector
(0, 0, 0).
one
Vector3
Vector3.oneThe vector
(1, 1, 1).
xAxis
Vector3
Vector3.xAxisThe unit vector along the X axis,
(1, 0, 0).
yAxis
Vector3
Vector3.yAxisThe unit vector along the Y axis,
(0, 1, 0).
zAxis
Vector3
Vector3.zAxisThe unit vector along the Z axis,
(0, 0, 1).
Constructors
new(X: Number, Y: Number, Z: Number)
Vector3Returns a new
Vector3from the given components.
Methods
Dot(other: Vector3)
Vector3Returns the dot product of two vectors.
Cross(other: Vector3)
Vector3Returns the cross product of two vectors.
Lerp(other: Vector3, alpha: Number)
Vector3Returns an interpolated vector between
selfandother.When alpha is
0.0it returnsself; whenalphais0.5it returns the vector directly betweenselfandother; whenalphais1.0it returnsother.
Operators
Vector3 + Vector3
Vector3Adds the components of two vectors.
Vector3 - Vector3
Vector3Subtracts the components of two vectors.
Vector3 * Vector3 | Number
Vector3Multiplies component-wise if both operands are
Vector3, or scales every component if one operand is aNumber.
Vector3 / Vector3 | Number
Vector3Divides component-wise if both operands are
Vector3, or scales every component if the denominator is aNumber.
-Vector3
Vector3Returns the negation of the vector.
Vector3 == Vector3
BooleanReturns whether two vectors have equal
X,Y, andZcomponents.
tostring(Vector3)
stringFormats the vector as
"X, Y, Z"with 3 decimal places, e.g."1.000, 2.000, 3.000".