updateCameraMatrix method

dynamic updateCameraMatrix()

Update the camera matrix and view matrix.

Implementation

updateCameraMatrix() {
  cameraMatrix = M4.lookAt(
    [position.x, position.y, position.z],
    [target.x, target.y, target.z],
    [up.x, up.y, up.z],
  );
  viewMatrix = M4.inverse(cameraMatrix);

  // Set the camera related uniforms.
  uniforms['u_projection'] = projectionMatrix;
  uniforms['u_view'] = viewMatrix;
}