(getter) Vector area.
(getter) Returns the basic array representation of this vector.
(getter/setter) Vector height. Alias of Vector#x x
(getter/setter) Vector height. Alias of Vector#x x
(getter/setter) Spherical phi. For using a vec3 as spherical coordinates. Alias of Vector#y y
(getter/setter) Spherical radius. For using a vec3 as spherical coordinates. Alias of Vector#x x
(getter/setter) Spherical theta. For using a vec3 as spherical coordinates. Alias of Vector#z z
(getter/setter) Vector width. Alias of Vector#x x
Adds iteration to the object, allowing it to be destructured and iterated upon in various useful ways.
Adds a scalar to the vector, modifying both the x and y
The scalar to add to the vector
Returns itself, modified
Clones the vector and adds the scalar to it instead
The scalar to add to the vector
Returns the clone of itself, modified
Calculates the distance between this and the supplied vector
The vector to calculate the distance from
The distance between this and the supplied vector
Calculates the distance on the X axis between this and the supplied vector
The vector to calculate the distance from
The distance, along the x axis, between this and the supplied vector
Calculated the distance on the Y axis between this and the supplied vector
The vector to calculate the distance from
The distance, along the y axis, between this and the supplied vector
Calculated the distance on the Z axis between this and the supplied vector
The vector to calculate the distance from
The distance, along the y axis, between this and the supplied vector
Divides the vector by a scalar.
The scalar to divide both x and y by
Returns itself, modified
Clones the vector and divides it by the provided scalar.
The scalar to divide both x and y by
Returns the clone of itself, modified
Calculates the dot product between this and a supplied vector
The vector object against which to calculate the dot product
The dot product of the two vectors
Multiplies the vector by a scalar.
The scalar to multiply both x and y by
Returns itself, modified
Clones the vector and multiplies it by the provided scalar.
The scalar to multiply both x and y by
Returns the clone of itself, modified
Subtracts a scalar from the vector, modifying both the x and y
The scalar to subtract from the vector
Returns itself, modified
Clones the vector and subtracts the scalar from it instead
The scalar to add to the vector
Returns the clone of itself, modified
StaticfromStaticgetStaticinterpolateStaticlerp
A basic 3D Vector class that provides simple algebraic functionality in the form of 3D Vectors.
We use Getters/setters for both principle properties (x & y) as well as virtual properties (rotation, length etc.).
Vec3
Author
Liam Egan liam@wethecollective.com
Version
1.0.0
Created
Jan 07, 2020