goog.vec.Vec3
Functions
Takes the absolute value of each component of vec0 storing the result in resultVec.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Performs a component-wise addition of vec0 and vec1 together storing the result into resultVec.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
clone( vec ) → Float32Array
Float32Array
cloneFloat32( vec ) → Float32Array
Float32Array
Creates a clone of the given 3 element Float32 vector.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
cloneFloat64( vec ) → Float64Array
Float64Array
Creates a clone of the given 3 element vector.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
create() → Float32Array
Float32Array
Creates a 3 element vector of Float32Array. The array is initialized to zero.
warning Deprecated | Use createFloat32. |
---|
Parameters | None. | ||
---|---|---|---|
Returns |
|
createFloat32() → Float32Array
Float32Array
Creates a 3 element vector of Float32. The array is initialized to zero.
Parameters | None. | ||
---|---|---|---|
Returns |
|
createFloat32FromArray( vec ) → Float32Array
Float32Array
createFloat32FromValues( v0, v1, v2 ) → Float32Array
Float32Array
createFloat64() → Float64Array
Float64Array
Creates a 3 element vector of Float64. The array is initialized to zero.
Parameters | None. | ||
---|---|---|---|
Returns |
|
createFloat64FromArray( vec ) → Float64Array
Float64Array
createFloat64FromValues( v0, v1, v2 ) → Float64Array
Float64Array
createFromArray( vec ) → Float32Array
Float32Array
createFromValues( v0, v1, v2 ) → Float32Array
Float32Array
Computes the vector (cross) product of v0 and v1 storing the result into resultVec.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Returns a unit vector pointing from one point to another. If the input points are equal then the result will be all zeros.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
distance( vec0, vec1 ) → number
number
distanceSquared( vec0, vec1 ) → number
number
dot( v0, v1 ) → number
number
equals( v0, v1 ) → boolean
boolean
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.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
magnitude( vec0 ) → number
number
magnitudeSquared( vec0 ) → number
number
Compares the components of vec0 with the components of another vector or scalar, storing the larger values in resultVec.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Compares the components of vec0 with the components of another vector or scalar, storing the smaller values in resultVec.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Negates vec0, storing the result into resultVec.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Normalizes the given vector storing the result into resultVec.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Multiplies each component of vec0 with scalar storing the product into resultVec.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Initializes the vector with the given array of values.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Initializes the vector with the given values.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Performs a component-wise subtraction of vec1 from vec0 storing the result into resultVec.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Properties
No information.
Float32 → Float32Array
Float32Array
No information.
Float64 → Float64Array
Float64Array
No information.
No information.
Type → Float32Array
Float32Array
No information.
No information.