Class InstancingManager

java.lang.Object
com.ardor3d.scenegraph.InstancingManager

public class InstancingManager extends Object
  • Constructor Details

    • InstancingManager

      public InstancingManager()
  • Method Details

    • registerMesh

      public void registerMesh(Mesh mesh)
      Register a mesh for instancing for this current frame (internal use only)
      Parameters:
      mesh - the mesh to register
    • fillTransformBuffer

      protected FloatBuffer fillTransformBuffer()
      Fill the buffer with the transforms and return it
      Returns:
      the transform buffer
    • getPrimitiveCount

      public int getPrimitiveCount()
      Returns the number of meshes to be drawn in this batch. This function is only valid after the apply call (internal use only)
      Returns:
      the number of meshes to be drawn in this batch
    • getMaxBatchSize

      public int getMaxBatchSize()
      Split the batch in multiple batches if number of visible meshes exceeds this amount. Using larger batches will lead to better performance, although you might overflow the uniform space of the shader/videocard (crashes)
      Returns:
      maximum batch size
    • setMaxBatchSize

      public void setMaxBatchSize(int maxBatchSize)
      Split the batch in multiple batches if number of visible meshes exceeds this amount. Using larger batches will lead to better performance, although you might overflow the uniform space of the shader/videocard (crashes)
      Parameters:
      maxBatchSize - maximum batch size
    • isAddedToRenderQueue

      public boolean isAddedToRenderQueue()
    • apply

      public boolean apply(Mesh mesh, Renderer renderer, GLSLShaderObjectsState shader)
      Applies all instancing info to the mesh and returns if the current render call is allowed to continue
      Parameters:
      mesh - the mesh
      renderer - the renderer
      shader - the shader
      Returns:
      continue rendering or skip rendering all together