Class AbstractInstancer<D extends InstanceData>

java.lang.Object
com.jozufozu.flywheel.backend.instancing.AbstractInstancer<D>
All Implemented Interfaces:
Instancer<D>
Direct Known Subclasses:
CPUInstancer, GPUInstancer

public abstract class AbstractInstancer<D extends InstanceData> extends Object implements Instancer<D>
  • Field Details

  • Constructor Details

    • AbstractInstancer

      protected AbstractInstancer(Supplier<D> factory, Model modelData)
  • Method Details

    • createInstance

      public D createInstance()
      Specified by:
      createInstance in interface Instancer<D extends InstanceData>
      Returns:
      a handle to a new copy of this model.
    • stealInstance

      public void stealInstance(D inOther)
      Copy a data from another Instancer to this. This has the effect of swapping out one model for another.
      Specified by:
      stealInstance in interface Instancer<D extends InstanceData>
      Parameters:
      inOther - the data associated with a different model.
    • notifyRemoval

      public void notifyRemoval()
      Description copied from interface: Instancer
      Notify the Instances that some of its data should be removed.

      By the time the next frame is drawn, the instanceData passed will no longer be considered for rendering.

      Specified by:
      notifyRemoval in interface Instancer<D extends InstanceData>
    • clear

      public void clear()
      Clear all instance data without freeing resources.
    • getModelVertexCount

      public int getModelVertexCount()
    • getInstanceCount

      public int getInstanceCount()
    • getVertexCount

      public int getVertexCount()
    • removeDeletedInstances

      protected void removeDeletedInstances()
    • toString

      public String toString()
      Overrides:
      toString in class Object