vec4.js
No description.

File Location

/goog/vec/vec4.js


Public Protected Private

Global Functions

goog.vec.Vec4.abs(vec0resultVec) !goog.vec.Vec4.AnyType
Takes the absolute value of each component of vec0 storing the result in resultVec.
Arguments:
vec0 : goog.vec.Vec4.AnyType
The source vector.
resultVec : goog.vec.Vec4.AnyType
The vector to receive the result. May be vec0.
Returns: !goog.vec.Vec4.AnyType  Return resultVec so that operations can be chained together.
code »
goog.vec.Vec4.add(vec0vec1resultVec) !goog.vec.Vec4.AnyType
Performs a component-wise addition of vec0 and vec1 together storing the result into resultVec.
Arguments:
vec0 : goog.vec.Vec4.AnyType
The first addend.
vec1 : goog.vec.Vec4.AnyType
The second addend.
resultVec : goog.vec.Vec4.AnyType
The vector to receive the result. May be vec0 or vec1.
Returns: !goog.vec.Vec4.AnyType  Return resultVec so that operations can be chained together.
code »
goog.vec.Vec4.clone(vec) !goog.vec.Vec4.Type
Use cloneFloat32. Creates a clone of the given 4 element vector.
Arguments:
vec : goog.vec.Vec4.Vec4Like
The source 4 element vector.
Returns: !goog.vec.Vec4.Type  The new cloned vector.
code »
goog.vec.Vec4.cloneFloat32(vec) !goog.vec.Vec4.Float32
Creates a clone of the given 4 element Float32 vector.
Arguments:
vec : goog.vec.Vec4.Float32
The source 3 element vector.
Returns: !goog.vec.Vec4.Float32  The new cloned vector.
code »
goog.vec.Vec4.cloneFloat64(vec) !goog.vec.Vec4.Float64
Creates a clone of the given 4 element vector.
Arguments:
vec : goog.vec.Vec4.Float64
The source 4 element vector.
Returns: !goog.vec.Vec4.Float64  The new cloned vector.
code »
goog.vec.Vec4.create() !goog.vec.Vec4.Type
Use createFloat32. Creates a 4 element vector of Float32Array. The array is initialized to zero.
Returns: !goog.vec.Vec4.Type  The new 4 element array.
code »
goog.vec.Vec4.createFloat32() !goog.vec.Vec4.Float32
Creates a 4 element vector of Float32. The array is initialized to zero.
Returns: !goog.vec.Vec4.Float32  The new 3 element array.
code »
goog.vec.Vec4.createFloat32FromArray(vec) !goog.vec.Vec4.Float32
Creates a new 4 element FLoat32 vector initialized with the value from the given array.
Arguments:
vec : goog.vec.Vec4.AnyType
The source 3 element array.
Returns: !goog.vec.Vec4.Float32  The new 3 element array.
code »
goog.vec.Vec4.createFloat32FromValues(v0v1v2v3) !goog.vec.Vec4.Float32
Creates a new 4 element Float32 vector initialized with the supplied values.
Arguments:
v0 : number
The value for element at index 0.
v1 : number
The value for element at index 1.
v2 : number
The value for element at index 2.
v3 : number
The value for element at index 3.
Returns: !goog.vec.Vec4.Float32  The new vector.
code »
goog.vec.Vec4.createFloat64() !goog.vec.Vec4.Float64
Creates a 4 element vector of Float64. The array is initialized to zero.
Returns: !goog.vec.Vec4.Float64  The new 4 element array.
code »
goog.vec.Vec4.createFloat64FromArray(vec) !goog.vec.Vec4.Float64
Creates a new 4 element Float64 vector initialized with the value from the given array.
Arguments:
vec : goog.vec.Vec4.AnyType
The source 4 element array.
Returns: !goog.vec.Vec4.Float64  The new 4 element array.
code »
goog.vec.Vec4.createFloat64FromValues(v0v1v2v3) !goog.vec.Vec4.Float64
Creates a new 4 element Float64 vector initialized with the supplied values.
Arguments:
v0 : number
The value for element at index 0.
v1 : number
The value for element at index 1.
v2 : number
The value for element at index 2.
v3 : number
The value for element at index 3.
Returns: !goog.vec.Vec4.Float64  The new vector.
code »
goog.vec.Vec4.createFromArray(vec) !goog.vec.Vec4.Type
Use createFloat32FromArray. Creates a new 4 element vector initialized with the value from the given array.
Arguments:
vec : goog.vec.Vec4.Vec4Like
The source 4 element array.
Returns: !goog.vec.Vec4.Type  The new 4 element array.
code »
goog.vec.Vec4.createFromValues(v0v1v2v3) !goog.vec.Vec4.Type
Use createFloat32FromValues. Creates a new 4 element vector initialized with the supplied values.
Arguments:
v0 : number
The value for element at index 0.
v1 : number
The value for element at index 1.
v2 : number
The value for element at index 2.
v3 : number
The value for element at index 3.
Returns: !goog.vec.Vec4.Type  The new vector.
code »
goog.vec.Vec4.createNumber() !goog.vec.Vec4.Number
Creates a 4 element vector of Number. The array is initialized to zero.
Returns: !goog.vec.Vec4.Number  The new 4 element array.
code »
goog.vec.Vec4.dot(v0v1) number
Returns the scalar product of vectors v0 and v1.
Arguments:
v0 : goog.vec.Vec4.AnyType
The first vector.
v1 : goog.vec.Vec4.AnyType
The second vector.
Returns: number  The scalar product.
code »
goog.vec.Vec4.equals(v0v1) boolean
Returns true if the components of v0 are equal to the components of v1.
Arguments:
v0 : goog.vec.Vec4.AnyType
The first vector.
v1 : goog.vec.Vec4.AnyType
The second vector.
Returns: boolean  True if the vectors are equal, false otherwise.
code »
goog.vec.Vec4.lerp(v0v1fresultVec) !goog.vec.Vec4.AnyType
Linearly interpolate from v0 to v1 according to f. The value of f should be in the range [0..1] otherwise the results are undefined.
Arguments:
v0 : goog.vec.Vec4.AnyType
The first vector.
v1 : goog.vec.Vec4.AnyType
The second vector.
f : number
The interpolation factor.
resultVec : goog.vec.Vec4.AnyType
The vector to receive the results (may be v0 or v1).
Returns: !goog.vec.Vec4.AnyType  Return resultVec so that operations can be chained together.
code »
goog.vec.Vec4.magnitude(vec0) number
Returns the magnitude of the given vector.
Arguments:
vec0 : goog.vec.Vec4.AnyType
The vector.
Returns: number  The magnitude of the vector.
code »
goog.vec.Vec4.magnitudeSquared(vec0) number
Returns the magnitudeSquared of the given vector.
Arguments:
vec0 : goog.vec.Vec4.AnyType
The vector.
Returns: number  The magnitude of the vector.
code »
goog.vec.Vec4.max(vec0limitresultVec) !goog.vec.Vec4.AnyType
Compares the components of vec0 with the components of another vector or scalar, storing the larger values in resultVec.
Arguments:
vec0 : goog.vec.Vec4.AnyType
The source vector.
limit : goog.vec.Vec4.AnyType | number
The limit vector or scalar.
resultVec : goog.vec.Vec4.AnyType
The vector to receive the results (may be vec0 or limit).
Returns: !goog.vec.Vec4.AnyType  Return resultVec so that operations can be chained together.
code »
goog.vec.Vec4.min(vec0limitresultVec) !goog.vec.Vec4.AnyType
Compares the components of vec0 with the components of another vector or scalar, storing the smaller values in resultVec.
Arguments:
vec0 : goog.vec.Vec4.AnyType
The source vector.
limit : goog.vec.Vec4.AnyType | number
The limit vector or scalar.
resultVec : goog.vec.Vec4.AnyType
The vector to receive the results (may be vec0 or limit).
Returns: !goog.vec.Vec4.AnyType  Return resultVec so that operations can be chained together.
code »
goog.vec.Vec4.negate(vec0resultVec) !goog.vec.Vec4.AnyType
Negates vec0, storing the result into resultVec.
Arguments:
vec0 : goog.vec.Vec4.AnyType
The vector to negate.
resultVec : goog.vec.Vec4.AnyType
The vector to receive the result. May be vec0.
Returns: !goog.vec.Vec4.AnyType  Return resultVec so that operations can be chained together.
code »
goog.vec.Vec4.normalize(vec0resultVec) !goog.vec.Vec4.AnyType
Normalizes the given vector storing the result into resultVec.
Arguments:
vec0 : goog.vec.Vec4.AnyType
The vector to normalize.
resultVec : goog.vec.Vec4.AnyType
The vector to receive the result. May be vec0.
Returns: !goog.vec.Vec4.AnyType  Return resultVec so that operations can be chained together.
code »
goog.vec.Vec4.scale(vec0scalarresultVec) !goog.vec.Vec4.AnyType
Multiplies each component of vec0 with scalar storing the product into resultVec.
Arguments:
vec0 : goog.vec.Vec4.AnyType
The source vector.
scalar : number
The value to multiply with each component of vec0.
resultVec : goog.vec.Vec4.AnyType
The vector to receive the result. May be vec0.
Returns: !goog.vec.Vec4.AnyType  Return resultVec so that operations can be chained together.
code »
goog.vec.Vec4.setFromArray(vecvalues) !goog.vec.Vec4.AnyType
Initializes the vector with the given array of values.
Arguments:
vec : goog.vec.Vec4.AnyType
The vector to receive the values.
values : goog.vec.Vec4.AnyType
The array of values.
Returns: !goog.vec.Vec4.AnyType  Return vec so that operations can be chained together.
code »
goog.vec.Vec4.setFromValues(vecv0v1v2v3) !goog.vec.Vec4.AnyType
Initializes the vector with the given values.
Arguments:
vec : goog.vec.Vec4.AnyType
The vector to receive the values.
v0 : number
The value for element at index 0.
v1 : number
The value for element at index 1.
v2 : number
The value for element at index 2.
v3 : number
The value for element at index 3.
Returns: !goog.vec.Vec4.AnyType  Return vec so that operations can be chained together.
code »
goog.vec.Vec4.subtract(vec0vec1resultVec) !goog.vec.Vec4.AnyType
Performs a component-wise subtraction of vec1 from vec0 storing the result into resultVec.
Arguments:
vec0 : goog.vec.Vec4.AnyType
The minuend.
vec1 : goog.vec.Vec4.AnyType
The subtrahend.
resultVec : goog.vec.Vec4.AnyType
The vector to receive the result. May be vec0 or vec1.
Returns: !goog.vec.Vec4.AnyType  Return resultVec so that operations can be chained together.
code »

Directory vec

File Reference