The Vector Class constructor
(getter/setter) The y value of the vector.
(getter/setter) The x value of the vector.
(getter/setter) The y value of the vector.
(getter/setter) The y value of the vector.
(getter) Vector area.
(getter) Returns the basic array representation of this vector.
(getter/setter) Vector height. Alias of {@link Vector#x x}
(getter/setter) Vector height. Alias of {@link Vector#x x}
(getter/setter) Vector height. Alias of {@link Vector#x x}
(getter/setter) Vector height. Alias of {@link Vector#x x}
(getter/setter) The length of the vector
(getter/setter) The length of the vector
(getter/setter) The length of the vector presented as a square. If you're using length for comparison, this is quicker.
(getter/setter) The length of the vector presented as a square. If you're using length for comparison, this is quicker.
(getter/setter) Vector width. Alias of {@link Vector#x x}
(getter/setter) Vector width. Alias of {@link Vector#x x}
(getter/sette) Swizzle WW
(getter/sette) Swizzle WW
(getter/sette) Swizzle wx
(getter/sette) Swizzle wx
(getter/sette) Swizzle XYZW
(getter/sette) Swizzle XYZW
(getter/sette) Swizzle WY
(getter/sette) Swizzle WY
(getter/sette) Swizzle WZ
(getter/sette) Swizzle WZ
(getter/sette) Swizzle XY
(getter/sette) Swizzle XY
(getter/sette) Swizzle XX
(getter/sette) Swizzle XX
(getter/sette) Swizzle XY
(getter/sette) Swizzle XY
(getter/sette) Swizzle YZX
(getter/sette) Swizzle YZX
(getter/sette) Swizzle XYZW
(getter/sette) Swizzle XYZW
(getter/sette) Swizzle XY
(getter/sette) Swizzle XY
(getter/sette) Swizzle YZ
(getter/sette) Swizzle YZ
(getter/sette) Swizzle YX
(getter/sette) Swizzle YX
(getter/sette) Swizzle YY
(getter/sette) Swizzle YY
(getter/sette) Swizzle YZ
(getter/sette) Swizzle YZ
(getter/sette) Swizzle XYZW
(getter/sette) Swizzle XYZW
(getter/sette) Swizzle YZX
(getter/sette) Swizzle YZX
(getter/sette) Swizzle XY
(getter/sette) Swizzle XY
(getter/sette) Swizzle XYZW
(getter/sette) Swizzle XYZW
(getter/sette) Swizzle zx
(getter/sette) Swizzle zx
(getter/sette) Swizzle ZXY
(getter/sette) Swizzle ZXY
(getter/sette) Swizzle ZY
(getter/sette) Swizzle ZY
(getter/sette) Swizzle ZZ
(getter/sette) Swizzle ZZ
Adds iteration to the object, allowing it to be destructured and iterated upon in various useful ways.
Adds one vector to another.
The vector to add to this one
Returns itself, modified
Clones the vector and adds the vector to it instead
The vector to add to this one
Returns the clone of itself, modified
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
Clones the vector
The cloned vector
Calculates the cross product between this and two other supplied vectors
The cross product of the two vectors
Calculates the distance between this and the supplied vector
The vector to calculate the distance from
The distance between this and the supplied vector
Calculated the distance on the W 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
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 one vector by another.
The vector to divide this by
Returns itself, modified
Clones the vector and divides it by the vector instead
The vector to divide the clone by
Returns the clone of itself, modified
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
Inverses the vector.
Returns itself, modified
Clones the vector and then inverses it.
Returns itself, modified
Multiplies one vector by another.
The vector to multiply this by
Returns itself, modified
Clones the vector and multiplies it by the vector instead
Returns the clone of itself, modified
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
Negates the vector.
Returns itself, modified
Clones the vector and negates it.
Returns itself, modified
Normalises the vector down to a length of 1 unit
Returns itself, modified
Clones the vector and normalises it
Returns a clone of itself, modified
Resets the vector coordinates
Resets the vector coordinates to another vector object
The vector object to use to reset the coordinates
Alias of {@link Vector#multiplyScalar__anchor multiplyScalar}
Alias of {@link Vector#multiplyScalarNew__anchor multiplyScalarNew}
Subtracts one vector from another.
The vector to subtract from this one
Returns itself, modified
Clones the vector and subtracts the vector from it instead
The vector to subtract from this one
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
Iterpolates a provided anonymous value into a vew Vec4
The value to interpolate
out
Performs a linear interpolation between two Vec4's
the first operand
the second operand
interpolation amount in the range of 0 - 1
Generated using TypeDoc
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.).
Liam Egan liam@wethecollective.com
1.0.0
Jan 07, 2020