com.io7m.r2.core

## Class R2SceneOpaques

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

- All Implemented Interfaces:
    R2SceneOpaquesReadableType, R2SceneOpaquesType

      public final class R2SceneOpaques
      extends Object
      implements R2SceneOpaquesType

  Default implementation of the `R2SceneOpaquesType` interface.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static R2SceneOpaquesType` | `newOpaques()`
    `<M> void` | `opaquesAddBatchedInstanceInGroup(R2InstanceBatchedType i, R2MaterialOpaqueBatchedType<M> m, int group)` Add a batched instance to the scene using the given material.
    `<M> void` | `opaquesAddBillboardedInstanceInGroup(R2InstanceBillboardedType i, R2MaterialOpaqueBillboardedType<M> m, int group)` Add a billboarded instance to the scene using the given material.
    `<M> void` | `opaquesAddSingleInstanceInGroup(R2InstanceSingleType i, R2MaterialOpaqueSingleType<M> m, int group)` Add a single instance to the scene using the given material.
    `long` | `opaquesCount()`
    `void` | `opaquesExecute(R2SceneOpaquesConsumerType c)` Batch the instances and pass them to the given consumer for rendering.
    `void` | `opaquesReset()` Remove all instances from the scene.

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

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

    - ### Methods inherited from interface com.io7m.r2.core.R2SceneOpaquesType

      `opaquesAddBatchedInstance, opaquesAddBillboardedInstance, opaquesAddSingleInstance`

- - ### Method Detail

    - #### newOpaques

          public static R2SceneOpaquesType newOpaques()

      Returns:
        A new empty set of opaques

    - #### opaquesReset

          public void opaquesReset()

      Description copied from interface: `R2SceneOpaquesType`
      Remove all instances from the scene.
      Specified by:
        `opaquesReset` in interface `R2SceneOpaquesType`

    - #### opaquesAddSingleInstanceInGroup

          public <M> void opaquesAddSingleInstanceInGroup(R2InstanceSingleType i,
                                                          R2MaterialOpaqueSingleType<M> m,
                                                          int group)

      Description copied from interface: `R2SceneOpaquesType`
      Add a single instance to the scene using the given material. The instance is placed into the specified `group`, which must be a value in the range `[1, {@link R2Stencils#MAXIMUM_GROUPS}]`.
      Specified by:
        `opaquesAddSingleInstanceInGroup` in interface `R2SceneOpaquesType`
      Type Parameters:
        `M` - The type of shader parameters
      Parameters:
        `i` - The instance
        `m` - The material
        `group` - The group

    - #### opaquesAddBatchedInstanceInGroup

          public <M> void opaquesAddBatchedInstanceInGroup(R2InstanceBatchedType i,
                                                           R2MaterialOpaqueBatchedType<M> m,
                                                           int group)

      Description copied from interface: `R2SceneOpaquesType`
      Add a batched instance to the scene using the given material. The instance is placed into the specified `group`, which must be a value in the range `[1, 127]`.
      Specified by:
        `opaquesAddBatchedInstanceInGroup` in interface `R2SceneOpaquesType`
      Type Parameters:
        `M` - The type of shader parameters
      Parameters:
        `i` - The instance
        `m` - The material
        `group` - The group

    - #### opaquesAddBillboardedInstanceInGroup

          public <M> void opaquesAddBillboardedInstanceInGroup(R2InstanceBillboardedType i,
                                                               R2MaterialOpaqueBillboardedType<M> m,
                                                               int group)

      Description copied from interface: `R2SceneOpaquesType`
      Add a billboarded instance to the scene using the given material. The instance is placed into the specified `group`, which must be a value in the range `[1, 127]`.
      Specified by:
        `opaquesAddBillboardedInstanceInGroup` in interface `R2SceneOpaquesType`
      Type Parameters:
        `M` - The type of shader parameters
      Parameters:
        `i` - The instance
        `m` - The material
        `group` - The group

    - #### opaquesExecute

          public void opaquesExecute(R2SceneOpaquesConsumerType c)

      Description copied from interface: `R2SceneOpaquesReadableType`
      Batch the instances and pass them to the given consumer for rendering.
      Specified by:
        `opaquesExecute` in interface `R2SceneOpaquesReadableType`
      Parameters:
        `c` - The consumer

    - #### opaquesCount

          public long opaquesCount()

      Specified by:
        `opaquesCount` in interface `R2SceneOpaquesReadableType`
      Returns:
        The number of instances in the scene

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