com.io7m.r2.core

## Class R2TransformT

- java.lang.Object
- - com.io7m.r2.core.R2TransformT

- All Implemented Interfaces:
    R2TransformOrthogonalReadableType, R2TransformReadableType, R2TransformType, R2TransformViewReadableType

      public final class R2TransformT
      extends Object
      implements R2TransformOrthogonalReadableType, R2TransformType

  A transform represented by a translation.

  The transform does not allow independent scaling on each axis and will therefore produce matrices that are guaranteed to be orthogonal.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.io7m.jtensors.parameterized.PVector3FType<R2SpaceWorldType>` | `getTranslation()`
    `static R2TransformT` | `newTransform()` Construct a transform using the default values: The translation `(0, 0, 0)`.
    `static R2TransformT` | `newTransformWithValues(com.io7m.jtensors.parameterized.PVector3FType<R2SpaceWorldType> in_translation)` Construct a transform using the given initial values.
    `R2WatchableType<R2TransformReadableType>` | `transformGetWatchable()`
    `void` | `transformMakeMatrix4x4F(R2TransformContextType context, com.io7m.jtensors.parameterized.PMatrixWritable4x4FType<R2SpaceObjectType,R2SpaceWorldType> m)` Produce a 4x4 matrix for the current transformation, writing the resulting matrix to `m`.
    `<T extends R2SpaceType,U extends R2SpaceType> void` | `transformMakeViewMatrix4x4F(R2TransformContextType context, com.io7m.jtensors.parameterized.PMatrixWritable4x4FType<T,U> m)` Produce a view matrix for the transform.
    `R2WatchableType<R2TransformOrthogonalReadableType>` | `transformOrthogonalGetWatchable()`

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

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

- - ### Method Detail

    - #### newTransformWithValues

          public static R2TransformT newTransformWithValues(com.io7m.jtensors.parameterized.PVector3FType<R2SpaceWorldType> in_translation)

      Construct a transform using the given initial values. The given vectors are not copied; any modifications made to them will be reflected in the transform.
      Parameters:
        `in_translation` - The translation
      Returns:
        A new transform

    - #### newTransform

          public static R2TransformT newTransform()

      Construct a transform using the default values: The translation `(0, 0, 0)`.
      Returns:
        A new transform

    - #### getTranslation

          public com.io7m.jtensors.parameterized.PVector3FType<R2SpaceWorldType> getTranslation()

      Returns:
        A translation in world-space

    - #### transformMakeMatrix4x4F

          public void transformMakeMatrix4x4F(R2TransformContextType context,
                                              com.io7m.jtensors.parameterized.PMatrixWritable4x4FType<R2SpaceObjectType,R2SpaceWorldType> m)

      Description copied from interface: `R2TransformReadableType`
      Produce a 4x4 matrix for the current transformation, writing the resulting matrix to `m`.
      Specified by:
        `transformMakeMatrix4x4F` in interface `R2TransformReadableType`
      Parameters:
        `context` - The current transform context
        `m` - The matrix to which values will be written

    - #### transformGetWatchable

          public R2WatchableType<R2TransformReadableType> transformGetWatchable()

      Specified by:
        `transformGetWatchable` in interface `R2TransformReadableType`
      Returns:
        The watchable value for this transform

    - #### transformOrthogonalGetWatchable

          public R2WatchableType<R2TransformOrthogonalReadableType> transformOrthogonalGetWatchable()

      Specified by:
        `transformOrthogonalGetWatchable` in interface `R2TransformOrthogonalReadableType`
      Returns:
        The watchable value for this transform

    - #### transformMakeViewMatrix4x4F

          public <T extends R2SpaceType,U extends R2SpaceType> void transformMakeViewMatrix4x4F(R2TransformContextType context,
                                                                                                com.io7m.jtensors.parameterized.PMatrixWritable4x4FType<T,U> m)

      Description copied from interface: `R2TransformViewReadableType`
      Produce a view matrix for the transform. In this case, a view matrix is the view matrix required to place the observer at the transform's position, looking in the direction of the transform. In effect, this is the matrix resulting from the inverse of the transform.
      Specified by:
        `transformMakeViewMatrix4x4F` in interface `R2TransformViewReadableType`
      Type Parameters:
        `T` - The source coordinate system
        `U` - The target coordinate system
      Parameters:
        `context` - A transform context
        `m` - The output matrix

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