setValueM4 method

dynamic setValueM4(
  1. dynamic gl,
  2. Matrix4 v, [
  3. WebGLTextures? textures
])

Implementation

setValueM4(gl, Matrix4 v, [WebGLTextures? textures]) {
  var cache = this.cache;
  var elements = v.elements;

  if (elements == null) {
    if (arraysEqual(cache, v)) return;

    gl.uniformMatrix4fv(addr, false, v);

    copyArray(cache, v);
  } else {
    if (arraysEqual(cache, elements)) {
      return;
    }

    // TODO
    // mat4array.set( elements );

    gl.uniformMatrix4fv(addr, false, elements);

    copyArray(cache, elements);
  }
}