-
add(b, c)
-
Adds vectors from the two argument arrays, storing the result in this array.
Parameters:
Name |
Type |
Description |
b |
VecArray
|
Array of first terms. Its length must be identical to this array's length. |
c |
VecArray
|
Array of second terms. Its length must be identical to this array's length. |
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
addAll(b, c)
-
Adds a vector to all argument array elements, storing the result in this array.
Parameters:
Name |
Type |
Description |
b |
VecArray
|
Array of first operands. Same length as this. |
c |
Vec
|
Second operand. |
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
addScaled(b, c, dt)
-
Adds vectors from the two argument arrays, scaling the second arguments, storing the result in this array.
Parameters:
Name |
Type |
Description |
b |
VecArray
|
Array of first terms. Its length must be identical to this array's length. |
c |
VecArray
|
Array of second terms. Its length must be identical to this array's length. |
dt |
Number
|
Single scalar scaling factor. |
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
at(index)
-
Returns a new Vec3 object that captures an element of the array. The new vector is a view on the original data, not a copy.
Parameters:
Name |
Type |
Description |
index |
Number
|
Index of the element. |
Returns:
new view on one of the array's elements
-
Type
-
Vec3
-
clamp()
-
Constrains values in the array to the [0,1) interval.
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
commit(gl, uniformLocation)
-
Sets the value of the vector array to a WebGL vec3 array uniform variable.
Parameters:
Name |
Type |
Description |
gl |
WebGLRenderingContext
|
rendering context |
uniformLocation |
WebGLUniformLocation
|
location of the uniform variable in the currently used WebGL program |
-
cross(b, c)
-
Computes the cross products of the vectors from the argument array, storing the results in this array.
Parameters:
Name |
Type |
Description |
b |
Vec3Array
|
Array of left operands. Its length must be identical to this array's length. |
c |
Vec3Array
|
Array of right operands. Its length must be identical to this array's length. |
Returns:
the cross products
-
Type
-
Vec3Array
-
div(b, c)
-
Divides, elementwise, vectors from the two argument arrays, storing the result in this array.
Parameters:
Name |
Type |
Description |
b |
VecArray
|
Array of dividends. |
c |
VecArray
|
Array of divisors. |
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
divAll(b, c)
-
Divides (elementwise) all argument array elements with a vector, storing the result in this array.
Parameters:
Name |
Type |
Description |
b |
VecArray
|
Array of first operands. Same length as this. |
c |
Vec
|
Second operand. |
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
divWithVec1s(b, c)
-
Divides, elementwise, vectors from the two argument arrays, repeating individual values of the second one to produce the same number of values as in the output array.
Parameters:
Name |
Type |
Description |
b |
VecArray
|
Array of dividends. Its length must be identical to this array's length. |
c |
Vec1Array
|
Array of divisors. Its length must be identical to this array's length. |
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
exp(b, c)
-
Exponentiates vectors from an array with a scalar, storing the result in this array. For scaling with factors stored in an array, see
mulAll.
Parameters:
Name |
Type |
Description |
b |
VecArray
|
Array of vectors to scale. Its length must be identical to this array's length. |
c |
VecArray
|
Exponent. |
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
mul(b, c)
-
Multipies, elementwise, vectors from the two argument arrays, storing the result in this array.
Parameters:
Name |
Type |
Description |
b |
VecArray
|
Array of factors. Its length must be identical to this array's length. |
c |
VecArray
|
Array of factors. Its length must be identical to this array's length. |
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
mulAll(b, c)
-
Multiplies (elementwise) a vector with all argument array elements, storing the result in this array.
Parameters:
Name |
Type |
Description |
b |
VecArray
|
Array of first operands. Same length as this. |
c |
Vec
|
Second operand. |
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
mulWithVec1s(b, c)
-
Multipies, elementwise, vectors from the two argument arrays, repeating individual values of the second one to produce the same number of elements as in the output array. For scaling with a single scalar factor, see
scale.
Parameters:
Name |
Type |
Description |
b |
Vec3Array
|
Array of factors. Its length must be identical to this array's length. |
c |
Vec1Array
|
Array of factors. Its length must be identical to this array's length. |
- Overrides:
Returns:
this
-
Type
-
Vec3Array
-
normalize(b)
-
Fills this vector with the unit length versions of vectors in the argument vector.
Parameters:
Name |
Type |
Description |
b |
Vec3Array
|
Array of vectors to normalize. Its length must be identical to this array's length. |
Returns:
this
-
Type
-
Vec3Array
-
random()
-
Fills the array with random values between 0 and 1.
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
scale(b, c)
-
Multipies vectors from an array with a scalar, storing the result in this array. For scaling with factors stored in an array, see
mulAll.
Parameters:
Name |
Type |
Description |
b |
VecArray
|
Array of vectors to scale. Its length must be identical to this array's length. |
c |
VecArray
|
Scale factor. |
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
set(data)
-
Sets the value of the vector array from another WebGLMath vector, vector array, matrix, or matrix array object, or an array of numbers.
Parameters:
Name |
Type |
Description |
data |
Array.<number>
|
Object
|
Input data. |
- Inherited From:
-
-
sub(b, c)
-
Subtracts vectors from the two argument arrays, storing the result in this array.
Parameters:
Name |
Type |
Description |
b |
VecArray
|
Array of minuends. Its length must be identical to this array's length. |
c |
VecArray
|
Array of subtrahends. Its length must be identical to this array's length. |
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
subAll(b, c)
-
Subtracts a vector from all argument array elements, storing the result in this array.
Parameters:
Name |
Type |
Description |
b |
VecArray
|
Array of first operands. Same length as this. |
c |
Vec
|
Second operand. |
- Inherited From:
-
Returns:
this
-
Type
-
VecArray
-
subarray( [begin] [, end])
-
Returns a new Vec3Array object that captures a subrange of the array. The new array is a view on the original data, not a copy.
Parameters:
Name |
Type |
Argument |
Default |
Description |
begin |
Number
|
<optional>
|
0
|
Element to begin at. The offset is inclusive. The whole array will be cloned if this value is not specified. |
end |
Number
|
<optional>
|
length
|
Element to end at. The offset is exclusive. If not specified, all elements from the one specified by begin to the end of the array are included in the new view. |
Returns:
new view on some of the array's elements
-
Type
-
Vec3Array
-
xyz0mul(v)
-
Fills this array with vectors from the argument array, augmented by a 0 to get a homogeneous direction vector, transformed by the argument 4x4 matrix. The vectors are cosidered row vectors, multiplied from the right with a matrix laid out in column-major order.
Parameters:
Name |
Type |
Description |
v |
Vec3Array
|
Array of vectors to transform. Its length must be identical to this array's length. |
Returns:
this
-
Type
-
Vec3Array
-
xyz1mul(v)
-
Fills this array with vectors from the argument array, augmented by a 1 to get a homogeneous position vector, transformed by the argument 4x4 matrix. The vectors are cosidered row vectors, multiplied from the right with a matrix laid out in column-major order.
Parameters:
Name |
Type |
Description |
v |
Vec3Array
|
Array of vectors to transform. Its length must be identical to this array's length. |
Returns:
this
-
Type
-
Vec3Array