vec.vec3f

Classes


Public Protected Private

Global Functions

goog.vec.vec3f.abs(vec0resultVec) !goog.vec.vec3f.Type
Takes the absolute value of each component of vec0 storing the result in resultVec.
Arguments:
vec0 : goog.vec.vec3f.Type
The source vector.
resultVec : goog.vec.vec3f.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec3f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3f.add(vec0vec1resultVec) !goog.vec.vec3f.Type
Performs a component-wise addition of vec0 and vec1 together storing the result into resultVec.
Arguments:
vec0 : goog.vec.vec3f.Type
The first addend.
vec1 : goog.vec.vec3f.Type
The second addend.
resultVec : goog.vec.vec3f.Type
The vector to receive the result. May be vec0 or vec1.
Returns: !goog.vec.vec3f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3f.create() !goog.vec.vec3f.Type
Creates a vec3f with all elements initialized to zero.
Returns: !goog.vec.vec3f.Type  The new vec3f.
code »
goog.vec.vec3f.cross(v0v1resultVec) !goog.vec.vec3f.Type
Computes the vector (cross) product of v0 and v1 storing the result into resultVec.
Arguments:
v0 : goog.vec.vec3f.Type
The first vector.
v1 : goog.vec.vec3f.Type
The second vector.
resultVec : goog.vec.vec3f.Type
The vector to receive the results. May be either v0 or v1.
Returns: !goog.vec.vec3f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3f.direction(vec0vec1resultVec) !goog.vec.vec3f.Type
Returns a unit vector pointing from one point to another. If the input points are equal then the result will be all zeros.
Arguments:
vec0 : goog.vec.vec3f.Type
Origin point.
vec1 : goog.vec.vec3f.Type
Target point.
resultVec : goog.vec.vec3f.Type
The vector to receive the results (may be vec0 or vec1).
Returns: !goog.vec.vec3f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3f.distance(vec0vec1) number
Returns the distance between two points.
Arguments:
vec0 : goog.vec.vec3f.Type
First point.
vec1 : goog.vec.vec3f.Type
Second point.
Returns: number  The distance between the points.
code »
goog.vec.vec3f.distanceSquared(vec0vec1) number
Returns the squared distance between two points.
Arguments:
vec0 : goog.vec.vec3f.Type
First point.
vec1 : goog.vec.vec3f.Type
Second point.
Returns: number  The squared distance between the points.
code »
goog.vec.vec3f.dot(v0v1) number
Returns the scalar product of vectors v0 and v1.
Arguments:
v0 : goog.vec.vec3f.Type
The first vector.
v1 : goog.vec.vec3f.Type
The second vector.
Returns: number  The scalar product.
code »
goog.vec.vec3f.equals(v0v1) boolean
Returns true if the components of v0 are equal to the components of v1.
Arguments:
v0 : goog.vec.vec3f.Type
The first vector.
v1 : goog.vec.vec3f.Type
The second vector.
Returns: boolean  True if the vectors are equal, false otherwise.
code »
goog.vec.vec3f.lerp(v0v1fresultVec) !goog.vec.vec3f.Type
Linearly interpolate from vec0 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.vec3f.Type
The first vector.
v1 : goog.vec.vec3f.Type
The second vector.
f : number
The interpolation factor.
resultVec : goog.vec.vec3f.Type
The vector to receive the results (may be v0 or v1).
Returns: !goog.vec.vec3f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3f.magnitude(vec0) number
Returns the magnitude of the given vector.
Arguments:
vec0 : goog.vec.vec3f.Type
The vector.
Returns: number  The magnitude of the vector.
code »
goog.vec.vec3f.magnitudeSquared(vec0) number
Returns the magnitudeSquared of the given vector.
Arguments:
vec0 : goog.vec.vec3f.Type
The vector.
Returns: number  The magnitude of the vector.
code »
goog.vec.vec3f.max(vec0limitresultVec) !goog.vec.vec3f.Type
Compares the components of vec0 with the components of another vector or scalar, storing the larger values in resultVec.
Arguments:
vec0 : goog.vec.vec3f.Type
The source vector.
limit : goog.vec.vec3f.Type | number
The limit vector or scalar.
resultVec : goog.vec.vec3f.Type
The vector to receive the results (may be vec0 or limit).
Returns: !goog.vec.vec3f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3f.min(vec0limitresultVec) !goog.vec.vec3f.Type
Compares the components of vec0 with the components of another vector or scalar, storing the smaller values in resultVec.
Arguments:
vec0 : goog.vec.vec3f.Type
The source vector.
limit : goog.vec.vec3f.Type | number
The limit vector or scalar.
resultVec : goog.vec.vec3f.Type
The vector to receive the results (may be vec0 or limit).
Returns: !goog.vec.vec3f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3f.negate(vec0resultVec) !goog.vec.vec3f.Type
Negates vec0, storing the result into resultVec.
Arguments:
vec0 : goog.vec.vec3f.Type
The vector to negate.
resultVec : goog.vec.vec3f.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec3f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3f.normalize(vec0resultVec) !goog.vec.vec3f.Type
Normalizes the given vector storing the result into resultVec.
Arguments:
vec0 : goog.vec.vec3f.Type
The vector to normalize.
resultVec : goog.vec.vec3f.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec3f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3f.scale(vec0scalarresultVec) !goog.vec.vec3f.Type
Multiplies each component of vec0 with scalar storing the product into resultVec.
Arguments:
vec0 : goog.vec.vec3f.Type
The source vector.
scalar : number
The value to multiply with each component of vec0.
resultVec : goog.vec.vec3f.Type
The vector to receive the result. May be vec0.
Returns: !goog.vec.vec3f.Type  Return resultVec so that operations can be chained together.
code »
goog.vec.vec3f.setFromArray(vecsrc) !goog.vec.vec3f.Type
Initializes vec3f vec from Array src.
Arguments:
vec : goog.vec.vec3f.Type
The destination vector.
src : Array.<number>
The source vector.
Returns: !goog.vec.vec3f.Type  Return vec so that operations can be chained together.
code »
goog.vec.vec3f.setFromValues(vecv0v1v2) !goog.vec.vec3f.Type
Initializes the vector with the given values.
Arguments:
vec : goog.vec.vec3f.Type
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.
Returns: !goog.vec.vec3f.Type  Return vec so that operations can be chained together.
code »
goog.vec.vec3f.setFromVec3d(vecsrc) !goog.vec.vec3f.Type
Initializes vec3f vec from vec3d src (typed as a Float64Array to avoid circular goog.requires).
Arguments:
vec : goog.vec.vec3f.Type
The destination vector.
src : Float64Array
The source vector.
Returns: !goog.vec.vec3f.Type  Return vec so that operations can be chained together.
code »
goog.vec.vec3f.setFromVec3f(vecsrc) !goog.vec.vec3f.Type
Initializes vec3f vec from vec3f src.
Arguments:
vec : goog.vec.vec3f.Type
The destination vector.
src : goog.vec.vec3f.Type
The source vector.
Returns: !goog.vec.vec3f.Type  Return vec so that operations can be chained together.
code »
goog.vec.vec3f.subtract(vec0vec1resultVec) !goog.vec.vec3f.Type
Performs a component-wise subtraction of vec1 from vec0 storing the result into resultVec.
Arguments:
vec0 : goog.vec.vec3f.Type
The minuend.
vec1 : goog.vec.vec3f.Type
The subtrahend.
resultVec : goog.vec.vec3f.Type
The vector to receive the result. May be vec0 or vec1.
Returns: !goog.vec.vec3f.Type  Return resultVec so that operations can be chained together.
code »

Global Properties

goog.vec.vec3f.Type :
No description.
Code »

Package vec

Package Reference