Class: Mat4Array

Mat4Array

Array of four by four matrices of 32-bit floats. May reflect an ESSL array-of-mat4s uniform variable.
Individual Mat4 elements are available through the index operator [].

new Mat4Array(size)

Parameters:
Name Type Description
size Number The number of Mat4 elements in the array.

Methods


at(index)

Returns a new Mat4 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
Mat4

commit(gl, uniformLocation)

Copies the value of the matrix array to a WebGL mat4 array uniform variable.
Parameters:
Name Type Description
gl WebGLRenderingContext rendering context
uniformLocation WebGLUniformLocation location of the uniform variable in the currently used WebGL program

set(data)

Sets the value of the matrix 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.

subarray( [begin] [, end])

Returns a new Mat4Array 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
Mat4Array