com.io7m.jcanephora.core

## Class JCGLViewMatrices

- java.lang.Object
- - com.io7m.jcanephora.core.JCGLViewMatrices

- All Implemented Interfaces:
    JCGLViewMatricesType

      public final class JCGLViewMatrices
      extends Object
      implements JCGLViewMatricesType

  Functions to produce view matrices. Memory for this implementation is allocated on creation of the class instance and reused.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `lookAt(com.io7m.jtensors.MatrixWritable4x4FType out, com.io7m.jtensors.VectorReadable3FType camera, com.io7m.jtensors.VectorReadable3FType target, com.io7m.jtensors.VectorReadable3FType up)` Calculate a view matrix representing a camera looking from the point `camera` to the point `target`.
    `static JCGLViewMatricesType` | `newMatrices()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### newMatrices

          public static JCGLViewMatricesType newMatrices()

      Returns:
        A `JCGLViewMatricesType` instance

    - #### lookAt

          public void lookAt(com.io7m.jtensors.MatrixWritable4x4FType out,
                             com.io7m.jtensors.VectorReadable3FType camera,
                             com.io7m.jtensors.VectorReadable3FType target,
                             com.io7m.jtensors.VectorReadable3FType up)

      Description copied from interface: `JCGLViewMatricesType`

      Calculate a view matrix representing a camera looking from the point `camera` to the point `target`. `target` must represent the "up" vector for the camera. Usually, this is simply a unit vector `(0, 1, 0)` representing the Y axis.

      The view is expressed as a translation and a rotation matrix, which is multiplied with the contents of `out`. Therefore, for most use cases, `out` should be set to the 4x4 identity matrix before calling the function.

      Specified by:
        `lookAt` in interface `JCGLViewMatricesType`
      Parameters:
        `out` - The input/output matrix.
        `camera` - The position of the viewer.
        `target` - The target being viewed.
        `up` - The up vector.

Copyright © 2016 <code@io7m.com> http://io7m.com