Part of a fork of @toji's
gl-matrix split into smaller pieces: this
package contains glMatrix.vec4
.
Will load all of the module's functionality and expose it on a single object. Note that any of the methods may also be required directly from their files.
For example, the following are equivalent:
var scale = require('gl-vec4').scale
var scale = require('gl-vec4/scale')
- add()
- clone()
- copy()
- create()
- distance()
- divide()
- dot()
- fromValues()
- inverse()
- length()
- lerp()
- max()
- min()
- multiply()
- negate()
- normalize()
- random()
- scale()
- scaleAndAdd()
- set()
- squaredDistance()
- squaredLength()
- subtract()
- transformMat4()
- transformQuat()
Adds two vec4's
Creates a new vec4 initialized with values from an existing vector
Copy the values from one vec4 to another
Creates a new, empty vec4
Calculates the euclidian distance between two vec4's
Divides two vec4's
Calculates the dot product of two vec4's
Creates a new vec4 initialized with the given values
Returns the inverse of the components of a vec4
Calculates the length of a vec4
Performs a linear interpolation between two vec4's
Returns the maximum of two vec4's
Returns the minimum of two vec4's
Multiplies two vec4's
Negates the components of a vec4
Normalize a vec4
Generates a random vector with the given scale
Scales a vec4 by a scalar number
Adds two vec4's after scaling the second operand by a scalar value
Set the components of a vec4 to the given values
Calculates the squared euclidian distance between two vec4's
Calculates the squared length of a vec4
Subtracts vector b from vector a
Transforms the vec4 with a mat4.
Transforms the vec4 with a quat
MIT. See LICENSE.md for details.