-
Notifications
You must be signed in to change notification settings - Fork 0
Vector3
The Vector3 is the must commonly used vector for 3D.
import { Vector3 } from "noobgl-vector";new Vector3(x, y, z);-
x(optional) the vector value of the x axis (default 0). -
y(optional) the vector value of the y axis (default 0). -
z(optional) the vector value of the z axis (default 0).
.x the current value of the x axis.
.y the current value of the y axis.
.z the current value of the z axis.
.length the current length of the vector.
set(x, y, z)Set the current values of the x, y and z axis.
-
xthe value of the x axis to set. -
ythe value of the y axis to set. -
zthe value of the z axis to set.
add(x, y, z)Add these values to the current vector.
-
xthe value to add to the x axis. -
ythe value to add to the y axis. -
zthe value to add to the z axis.
subtract(x, y, z)Subtract these values to the current vector.
-
xthe value to subtract to the x axis. -
ythe value to subtract to the y axis. -
zthe value to subtract to the z axis.
multiply(x, y, z)Multiply these values with the current vector.
-
xthe value by which to multiply the x axis. -
ythe value by which to multiply the y axis. -
zthe value by which to multiply the z axis.
divide(x, y, z)Divide these values with the current vector.
-
xthe value by which to divide the x axis. -
ythe value by which to divide the y axis. -
zthe value by which to divide the z axis.
cross(x, y, z)Set the current values of the x, y and z axis to the cross product of the current vector and the given one.
-
xthe value by which to cross the x axis. -
ythe value by which to cross the y axis. -
zthe value by which to crioss the z axis.
normalize()Normalize the current vector's axis values.
clone()Clone the current vector into a new instance.
static length(x, y, z)Return the length of the given axis.
-
xthe value of the x axis. -
ythe value of the y axis. -
zthe value of the z axis.