Home

Library goog.vec.Vec3

Function Summary
add(?goog.vec.Vec3.AnyType vec0, ?goog.vec.Vec3.AnyType vec1, ?goog.vec.Vec3.AnyType resultVec) ⇒ !goog.vec.Vec3.AnyType

Performs a component-wise addition of vec0 and vec1 together storing the result into resultVec.

clone(?goog.vec.Vec3.Vec3Like vec) ⇒ !goog.vec.Vec3.Type

Creates a clone of the given 3 element vector.

create() ⇒ !goog.vec.Vec3.Type

Creates a 3 element vector of Float32Array. The array is initialized to zero.

createFloat32() ⇒ !goog.vec.Vec3.Float32

Creates a 3 element vector of Float32. The array is initialized to zero.

createFloat32FromArray(?goog.vec.Vec3.AnyType vec) ⇒ !goog.vec.Vec3.Float32

Creates a new 3 element FLoat32 vector initialized with the value from the given array.

createFloat32FromValues(number v0, number v1, number v2) ⇒ !goog.vec.Vec3.Float32

Creates a new 3 element Float32 vector initialized with the supplied values.

createFloat64() ⇒ !goog.vec.Vec3.Float64

Creates a 3 element vector of Float64. The array is initialized to zero.

createFloat64FromArray(?goog.vec.Vec3.AnyType vec) ⇒ !goog.vec.Vec3.Float64

Creates a new 3 element Float64 vector initialized with the value from the given array.

createFloat64FromValues(number v0, number v1, number v2) ⇒ !goog.vec.Vec3.Float64

Creates a new 3 element Float64 vector initialized with the supplied values.

createFromArray(?goog.vec.Vec3.Vec3Like vec) ⇒ !goog.vec.Vec3.Type

Creates a new 3 element vector initialized with the value from the given array.

createFromValues(number v0, number v1, number v2) ⇒ !goog.vec.Vec3.Type

Creates a new 3 element vector initialized with the supplied values.

createNumber() ⇒ !goog.vec.Vec3.Number

Creates a 3 element vector of Number. The array is initialized to zero.

cross(?goog.vec.Vec3.AnyType v0, ?goog.vec.Vec3.AnyType v1, ?goog.vec.Vec3.AnyType resultVec) ⇒ !goog.vec.Vec3.AnyType

Computes the vector (cross) product of v0 and v1 storing the result into resultVec.

direction(?goog.vec.Vec3.AnyType vec0, ?goog.vec.Vec3.AnyType vec1, ?goog.vec.Vec3.AnyType resultVec) ⇒ !goog.vec.Vec3.AnyType

Returns a unit vector pointing from one point to another. If the input points are equal then the result will be all zeros.

distance(?goog.vec.Vec3.AnyType vec0, ?goog.vec.Vec3.AnyType vec1) ⇒ number

Returns the distance between two points.

distanceSquared(?goog.vec.Vec3.AnyType vec0, ?goog.vec.Vec3.AnyType vec1) ⇒ number

Returns the squared distance between two points.

dot(?goog.vec.Vec3.AnyType v0, ?goog.vec.Vec3.AnyType v1) ⇒ number

Returns the scalar product of vectors v0 and v1.

equals(?goog.vec.Vec3.AnyType v0, ?goog.vec.Vec3.AnyType v1) ⇒ boolean

Returns true if the components of v0 are equal to the components of v1.

lerp(?goog.vec.Vec3.AnyType v0, ?goog.vec.Vec3.AnyType v1, number f, ?goog.vec.Vec3.AnyType resultVec) ⇒ !goog.vec.Vec3.AnyType

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.

magnitude(?goog.vec.Vec3.AnyType vec0) ⇒ number

Returns the magnitude of the given vector.

magnitudeSquared(?goog.vec.Vec3.AnyType vec0) ⇒ number

Returns the magnitudeSquared of the given vector.

negate(?goog.vec.Vec3.AnyType vec0, ?goog.vec.Vec3.AnyType resultVec) ⇒ !goog.vec.Vec3.AnyType

Negates vec0, storing the result into resultVec.

normalize(?goog.vec.Vec3.AnyType vec0, ?goog.vec.Vec3.AnyType resultVec) ⇒ !goog.vec.Vec3.AnyType

Normalizes the given vector storing the result into resultVec.

scale(?goog.vec.Vec3.AnyType vec0, number scalar, ?goog.vec.Vec3.AnyType resultVec) ⇒ !goog.vec.Vec3.AnyType

Multiplies each component of vec0 with scalar storing the product into resultVec.

setFromArray(?goog.vec.Vec3.AnyType vec, ?goog.vec.Vec3.AnyType values) ⇒ !goog.vec.Vec3.AnyType

Initializes the vector with the given array of values.

setFromValues(?goog.vec.Vec3.AnyType vec, number v0, number v1, number v2) ⇒ !goog.vec.Vec3.AnyType

Initializes the vector with the given values.

subtract(?goog.vec.Vec3.AnyType vec0, ?goog.vec.Vec3.AnyType vec1, ?goog.vec.Vec3.AnyType resultVec) ⇒ !goog.vec.Vec3.AnyType

Performs a component-wise subtraction of vec1 from vec0 storing the result into resultVec.