(getter) Vector area.
(getter) Returns the basic array representation of this vector.
Getters and setters
Adds iteration to the object, allowing it to be destructured and iterated upon in various useful ways.
ChainableAdds one vector to another.
The vector to add to this one
Returns itself, modified
ChainableClones the vector and adds the vector to it instead
The vector to add to this one
Returns the clone of itself, modified
ChainableAdds a scalar to the vector, modifying both the x and y
The scalar to add to the vector
Returns itself, modified
ChainableClones 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 first other vector
The second other vector
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
ChainableDivides one vector by another.
The vector to divide this by
Returns itself, modified
ChainableClones the vector and divides it by the vector instead
The vector to divide the clone by
Returns the clone of itself, modified
ChainableDivides the vector by a scalar.
The scalar to divide both x and y by
Returns itself, modified
ChainableClones the vector and divides it by the provided scalar.
The scalar to divide both x and y by
Returns the clone of itself, modified
ChainableInverses the vector.
Returns itself, modified
ChainableClones the vector and then inverses it.
Returns itself, modified
ChainableMultiplies one vector by another.
Returns itself, modified
ChainableClones the vector and multiplies it by the vector instead
The vector to multiply the clone by
Returns the clone of itself, modified
ChainableMultiplies the vector by a scalar.
The scalar to multiply both x and y by
Returns itself, modified
ChainableClones the vector and multiplies it by the provided scalar.
The scalar to multiply both x and y by
Returns the clone of itself, modified
ChainableNegates the vector.
Returns itself, modified
ChainableClones the vector and negates it.
Returns itself, modified
ChainableNormalises the vector down to a length of 1 unit
Returns itself, modified
ChainableClones the vector and normalises it
Returns a clone of itself, modified
ChainableResets the vector coordinates
The x, y, z and w coordinates
ChainableResets the vector coordinates to another vector object
The vector object to use to reset the coordinates
ChainableSubtracts one vector from another.
The vector to subtract from this one
Returns itself, modified
ChainableClones the vector and subtracts the vector from it instead
The vector to subtract from this one
Returns the clone of itself, modified
ChainableSubtracts a scalar from the vector, modifying both the x and y
The scalar to subtract from the vector
Returns itself, modified
ChainableClones the vector and subtracts the scalar from it instead
The scalar to add to the vector
Returns the clone of itself, modified
Returns a string representation of an object.
StaticfromStaticfromStaticgetStaticidentityStatic methods
StaticinterpolateStaticlerpStaticslerp
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.).
Vec4
Author
Liam Egan liam@wethecollective.com
Version
1.0.0
Created
Jan 07, 2020