Part of a fork of @toji's gl-matrix split into smaller pieces: this package contains glMatrix.vec3
.
vec3 = require('gl-vec3')
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-vec3').scale var scale = require('gl-vec3/scale')
Adds two vec3's
Get the angle between two 3D vectors
Math.ceil
the components of a vec3
Creates a new vec3 initialized with values from an existing vector
Copy the values from one vec3 to another
Creates a new, empty vec3
cross(out:vec3, a:vec3, b:vec3)Computes the cross product of two vec3's
Calculates the euclidian distance between two vec3's. Aliased as dist
Divides two vec3's. Aliased as div
Calculates the dot product of two vec3's
Returns whether or not the vectors have approximately the same elements in the same position.
exactEquals(a:vec3, b:vec3)Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
Math.floor
the components of a vec3
Perform some operation over an array of vec3s.
fromValues(x:Number, y:Number, z:Number)Creates a new vec3 initialized with the given values
inverse(out:vec3, a:vec3)Returns the inverse of the components of a vec3
Calculates the length of a vec3. Aliased as len
Performs a linear interpolation between two vec3's
max(out:vec3, a:vec3, b:vec3)Returns the maximum of two vec3's
min(out:vec3, a:vec3, b:vec3)Returns the minimum of two vec3's
multiply(out:vec3, a:vec3, b:vec3)Multiplies two vec3's. Aliased as mul
Negates the components of a vec3
normalize(out:vec3, a:vec3)Normalize a vec3
random(out:vec3, [scale]:Number)Generates a random vector with the given scale
rotateX(out:vec3, a:vec3, b:vec3, c:Number)Rotate a 3D vector around the x-axis
rotateY(out:vec3, a:vec3, b:vec3, c:Number)Rotate a 3D vector around the y-axis
rotateZ(out:vec3, a:vec3, b:vec3, c:Number)Rotate a 3D vector around the z-axis
Math.round
the components of a vec3
Scales a vec3 by a scalar number
scaleAndAdd(out:vec3, a:vec3, b:vec3, scale:Number)Adds two vec3's after scaling the second operand by a scalar value
set(out:vec3, x:Number, y:Number, z:Number)Set the components of a vec3 to the given values
squaredDistance(a:vec3, b:vec3)Calculates the squared euclidian distance between two vec3's. Aliased as sqrDist
Calculates the squared length of a vec3. Aliased as sqrLen
Subtracts vector b from vector a. Aliased as sub
Transforms the vec3 with a mat3.
transformMat4(out:vec3, a:vec3, m:mat4)Transforms the vec3 with a mat4. 4th vector component is implicitly '1'
transformQuat(out:vec3, a:vec3, q:quat)Transforms the vec3 with a unit quat
zlib. See LICENSE.md for details.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4