Constructor
The x coordinate of the vector
The y coordinate of the vector
The z coordinate of the vector
Returns true if the vectors are equal
Returns the length of the vector (sqrt(x^2 + y^2 + z^2)).
Returns the squared length of the vector
Returns a negated version of the vector.
Returns a normalized version of the vector.
Returns the distance between this point and otherPoint
Returns the squared distance between this point and otherPoint
Creates a new Vec3 instance from the first 3 elements of the given array.
Returns a new vector with the given vector transforms as a point.
Transforms the vector as a point by multiplying it with the given matrix. This will both rotate and translate the vector p. Assumes the matrix m doesn't contain any perspective projection.
Returns a new vector with the given vector transforms as a vector.
Transforms the vector as a vector by multiplying it with the given matrix. This will only rotate the vector. The translation part of the matrix will be ignored. Assumes the matrix m doesn't contain any perspective projection.
Generated using TypeDoc
An immutable 3d vector with x, y and z values.
Used for positions, normals and other 3d entities.