makeViewMatrix function

Matrix4 makeViewMatrix (Vector3 cameraPosition, Vector3 cameraFocusPosition, Vector3 upDirection)

Constructs a new OpenGL view matrix.

cameraPosition specifies the position of the camera. cameraFocusPosition specifies the position the camera is focused on. upDirection specifies the direction of the up vector (usually, +Y).

Implementation

Matrix4 makeViewMatrix(
    Vector3 cameraPosition, Vector3 cameraFocusPosition, Vector3 upDirection) {
  final Matrix4 r = new Matrix4.zero();
  setViewMatrix(r, cameraPosition, cameraFocusPosition, upDirection);
  return r;
}