com.io7m.jcamera

## Class JCameraFPSStyle

- java.lang.Object
- - com.io7m.jcamera.JCameraFPSStyle

- All Implemented Interfaces:
    JCameraFPSStyleReadableType, JCameraFPSStyleType, JCameraReadableType, JCameraType

      @EqualityStructural
      public final class JCameraFPSStyle
      extends Object
      implements JCameraFPSStyleType

  The default implementation of `JCameraFPSStyleType`.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cameraClampHorizontalDisable()` Do not clamp rotations around the horizontal axis.
    `void` | `cameraClampHorizontalEnable(float min, float max)` Clamp the possible rotations around the horizontal axis to the given bounds.
    `float` | `cameraGetAngleAroundHorizontal()`
    `float` | `cameraGetAngleAroundVertical()`
    `com.io7m.jtensors.VectorReadable3FType` | `cameraGetForward()`
    `com.io7m.jtensors.VectorReadable3FType` | `cameraGetPosition()`
    `com.io7m.jtensors.VectorReadable3FType` | `cameraGetRight()`
    `com.io7m.jtensors.VectorReadable3FType` | `cameraGetUp()`
    `JCameraFPSStyleSnapshot` | `cameraMakeSnapshot()`
    `void` | `cameraMakeViewMatrix(JCameraContext ctx, com.io7m.jtensors.Matrix4x4FType m)` Construct a view matrix for the camera, using preallocated storage in `ctx` and writing the result to `m`.
    `<T0,T1> void` | `cameraMakeViewPMatrix(JCameraContext ctx, com.io7m.jtensors.parameterized.PMatrix4x4FType<T0,T1> m)` Construct a view matrix for the camera, using preallocated storage in `ctx` and writing the result to `m`.
    `void` | `cameraMoveForward(float u)` Move the camera forward `u` units iff `u` is positive, or backward `u` units iff `u` is negative.
    `void` | `cameraMoveRight(float u)` Move the camera right `u` units iff `u` is positive, or left `u` units iff `u` is negative.
    `void` | `cameraMoveUp(float u)` Move the camera up `u` units iff `u` is positive, or down `u` units iff `u` is negative.
    `boolean` | `cameraRotateAroundHorizontal(float r)` Rotate by `r` radians around the local X axis.
    `void` | `cameraRotateAroundVertical(float r)` Rotate by `r` radians around the global Y axis.
    `void` | `cameraSetAngleAroundHorizontal(float h)` Set the angle around the horizontal axis to `h`.
    `void` | `cameraSetAngleAroundVertical(float v)` Set the angle around the vertical axis to `v`.
    `void` | `cameraSetPosition(com.io7m.jtensors.VectorReadable3FType v)` Set the position of the camera.
    `void` | `cameraSetPosition3f(float x, float y, float z)` Set the position of the camera.
    `boolean` | `equals(Object obj)`
    `int` | `hashCode()`
    `static JCameraFPSStyleType` | `newCamera()`
    `static JCameraFPSStyleType` | `newCameraFrom(JCameraFPSStyleReadableType c)`
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### newCamera

          public static JCameraFPSStyleType newCamera()

      Returns:
        A new FPS camera

    - #### newCameraFrom

          public static JCameraFPSStyleType newCameraFrom(JCameraFPSStyleReadableType c)

      Parameters:
        `c` - An existing camera
      Returns:
        A new FPS camera based on the given camera.

    - #### cameraClampHorizontalDisable

          public void cameraClampHorizontalDisable()

      Description copied from interface: `JCameraFPSStyleType`
      Do not clamp rotations around the horizontal axis.
      Specified by:
        `cameraClampHorizontalDisable` in interface `JCameraFPSStyleType`
      See Also:
        `JCameraFPSStyleType.cameraClampHorizontalEnable(float, float)`

    - #### cameraClampHorizontalEnable

          public void cameraClampHorizontalEnable(float min,
                                                  float max)

      Description copied from interface: `JCameraFPSStyleType`
      Clamp the possible rotations around the horizontal axis to the given bounds.
      Specified by:
        `cameraClampHorizontalEnable` in interface `JCameraFPSStyleType`
      Parameters:
        `min` - The minimum angle
        `max` - The maximum angle

    - #### cameraGetAngleAroundHorizontal

          public float cameraGetAngleAroundHorizontal()

      Specified by:
        `cameraGetAngleAroundHorizontal` in interface `JCameraFPSStyleReadableType`
      Returns:
        The angle around the horizontal axis.

    - #### cameraGetAngleAroundVertical

          public float cameraGetAngleAroundVertical()

      Specified by:
        `cameraGetAngleAroundVertical` in interface `JCameraFPSStyleReadableType`
      Returns:
        The angle around the vertical axis.

    - #### cameraGetForward

          public com.io7m.jtensors.VectorReadable3FType cameraGetForward()

      Specified by:
        `cameraGetForward` in interface `JCameraFPSStyleReadableType`
      Returns:
        The forward direction for the camera.

    - #### cameraGetPosition

          public com.io7m.jtensors.VectorReadable3FType cameraGetPosition()

      Specified by:
        `cameraGetPosition` in interface `JCameraFPSStyleReadableType`
      Returns:
        The position of the camera.

    - #### cameraGetRight

          public com.io7m.jtensors.VectorReadable3FType cameraGetRight()

      Specified by:
        `cameraGetRight` in interface `JCameraFPSStyleReadableType`
      Returns:
        The right direction for the camera.

    - #### cameraGetUp

          public com.io7m.jtensors.VectorReadable3FType cameraGetUp()

      Specified by:
        `cameraGetUp` in interface `JCameraFPSStyleReadableType`
      Returns:
        The up direction for the camera.

    - #### cameraMakeSnapshot

          public JCameraFPSStyleSnapshot cameraMakeSnapshot()

      Specified by:
        `cameraMakeSnapshot` in interface `JCameraFPSStyleReadableType`
      Returns:
        A snapshot of the current camera state.

    - #### cameraMakeViewMatrix

          public void cameraMakeViewMatrix(JCameraContext ctx,
                                           com.io7m.jtensors.Matrix4x4FType m)

      Description copied from interface: `JCameraReadableType`
      Construct a view matrix for the camera, using preallocated storage in `ctx` and writing the result to `m`.
      Specified by:
        `cameraMakeViewMatrix` in interface `JCameraReadableType`
      Parameters:
        `ctx` - Preallocated storage
        `m` - The output matrix

    - #### cameraMakeViewPMatrix

          public <T0,T1> void cameraMakeViewPMatrix(JCameraContext ctx,
                                                    com.io7m.jtensors.parameterized.PMatrix4x4FType<T0,T1> m)

      Description copied from interface: `JCameraReadableType`
      Construct a view matrix for the camera, using preallocated storage in `ctx` and writing the result to `m`.
      Specified by:
        `cameraMakeViewPMatrix` in interface `JCameraReadableType`
      Type Parameters:
        `T0` - The source coordinate system
        `T1` - The target coordiante system
      Parameters:
        `ctx` - Preallocated storage
        `m` - The output matrix

    - #### cameraMoveForward

          public void cameraMoveForward(float u)

      Description copied from interface: `JCameraFPSStyleType`

      Move the camera forward `u` units iff `u` is positive, or backward `u` units iff `u` is negative.

      The forward direction, in this case, means the current view direction.

      Specified by:
        `cameraMoveForward` in interface `JCameraFPSStyleType`
      Parameters:
        `u` - The units to move

    - #### cameraMoveRight

          public void cameraMoveRight(float u)

      Description copied from interface: `JCameraFPSStyleType`

      Move the camera right `u` units iff `u` is positive, or left `u` units iff `u` is negative.

      The right direction, in this case, means the direction perpendicular to the current view direction, `-π / 2` radians around the global Y axis.

      Specified by:
        `cameraMoveRight` in interface `JCameraFPSStyleType`
      Parameters:
        `u` - The units to move

    - #### cameraMoveUp

          public void cameraMoveUp(float u)

      Description copied from interface: `JCameraFPSStyleType`

      Move the camera up `u` units iff `u` is positive, or down `u` units iff `u` is negative.

      The up direction, in this case, means the direction towards positive infinity on the global Y axis.

      Specified by:
        `cameraMoveUp` in interface `JCameraFPSStyleType`
      Parameters:
        `u` - The units to move

    - #### cameraRotateAroundHorizontal

          public boolean cameraRotateAroundHorizontal(float r)

      Description copied from interface: `JCameraFPSStyleType`

      Rotate by `r` radians around the local X axis.

      Note that by convention, when looking towards negative infinity on an axis, a positive rotation value results in a counter-clockwise rotation on the axis.

      A human analogy would be that a positive value passed to this function causes the camera to look up towards the sky. A negative value causes the camera to look down towards the ground.

      Specified by:
        `cameraRotateAroundHorizontal` in interface `JCameraFPSStyleType`
      Parameters:
        `r` - The radians to rotate
      Returns:
        `true` if the rotation has been clamped
      See Also:
        `JCameraFPSStyleType.cameraClampHorizontalEnable(float, float)`

    - #### cameraRotateAroundVertical

          public void cameraRotateAroundVertical(float r)

      Description copied from interface: `JCameraFPSStyleType`

      Rotate by `r` radians around the global Y axis.

      Note that by convention, when looking towards negative infinity on an axis, a positive rotation value results in a counter-clockwise rotation on the axis.

      A human analogy would be that a positive value passed to this function causes the camera to turn left, while a negative value causes the camera to look right.

      Specified by:
        `cameraRotateAroundVertical` in interface `JCameraFPSStyleType`
      Parameters:
        `r` - The radians to rotate

    - #### cameraSetAngleAroundHorizontal

          public void cameraSetAngleAroundHorizontal(float h)

      Description copied from interface: `JCameraFPSStyleType`
      Set the angle around the horizontal axis to `h`.
      Specified by:
        `cameraSetAngleAroundHorizontal` in interface `JCameraFPSStyleType`
      Parameters:
        `h` - The angle.

    - #### cameraSetAngleAroundVertical

          public void cameraSetAngleAroundVertical(float v)

      Description copied from interface: `JCameraFPSStyleType`
      Set the angle around the vertical axis to `v`.
      Specified by:
        `cameraSetAngleAroundVertical` in interface `JCameraFPSStyleType`
      Parameters:
        `v` - The angle.

    - #### cameraSetPosition

          public void cameraSetPosition(com.io7m.jtensors.VectorReadable3FType v)

      Set the position of the camera.
      Specified by:
        `cameraSetPosition` in interface `JCameraFPSStyleType`
      Parameters:
        `v` - The position.

    - #### cameraSetPosition3f

          public void cameraSetPosition3f(float x,
                                          float y,
                                          float z)

      Set the position of the camera.
      Specified by:
        `cameraSetPosition3f` in interface `JCameraFPSStyleType`
      Parameters:
        `x` - The x coordinate.
        `y` - The y coordinate.
        `z` - The z coordinate.

    - #### equals

          public boolean equals(@Nullable
                                Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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