x:numberpropX component.
3D vector type with operators and helpers.
x:numberpropX component.
y:numberpropY component.
z:numberpropZ component.
v:Length():numberVector length.
v:Length2D():numberLength in the X-Y plane.
v:LengthSqr():numberSquared length, avoids the square root.
v:Length2DSqr():numberSquared length in the X-Y plane.
v:Normalized():Vector3Unit-length copy of the vector.
v:Normalize():numberNormalize in place; returns the original length.
v:Dot(v:Vector3):numberDot product with another vector.
v:Cross(v:Vector3):Vector3Cross product with another vector.
v:DistTo(v:Vector3):numberDistance to another vector.
v:DistTo2D(v:Vector3):numberDistance in the X-Y plane.
v:DistToSqr(v:Vector3):numberSquared distance to another vector.
v:IsZero(eps?:number):booleanTrue when all components are near zero.
v:Zero()Set all components to zero.
v:ToAngle():Vector3Convert a direction vector to Euler angles.
v:FromAngle():Vector3Forward direction from angle components.
v:Unpack():number, number, numberReturn x, y, z as separate values.
v:Clear()Zero the vector in place.
v:Forward():Vector3Forward vector from this angle.
v:Right():Vector3Right vector from this angle.
v:Up():Vector3Up vector from this angle.
v:Vectors():Vector3, Vector3, Vector3Forward, right and up vectors from this angle.
v:Angles():Vector3Euler angles from a direction vector.
Vector3(x?:number, y?:number, z?:number):Vector3Create a vector; missing args default to zero.
EulerAngles(pitch?:number, yaw?:number, roll?:number):Vector3Create an angle vector; Forward/Right/Up/Vectors work on it.
v + v2:Vector3Add a vector or a scalar.
v - v2:Vector3Subtract a vector or a scalar.
v * v2:Vector3Multiply by a vector or a scalar.
v / v2:Vector3Divide by a vector or a scalar.
-v:Vector3Negate all components.
v == v2:booleanComponent-wise equality.
tostring(v):stringFormat as "(x, y, z)".