Class GeometryList

java.lang.Object
com.jme3.renderer.queue.GeometryList
All Implemented Interfaces:
Iterable<Geometry>

public class GeometryList extends Object implements Iterable<Geometry>
This class is a special purpose list of Geometry objects for render queuing.
  • Constructor Details

    • GeometryList

      public GeometryList(GeometryComparator comparator)
      Initializes the GeometryList to use the given GeometryComparator to use for comparing geometries.
      Parameters:
      comparator - The comparator to use.
  • Method Details

    • setComparator

      public void setComparator(GeometryComparator comparator)
    • getComparator

      public GeometryComparator getComparator()
      Returns the GeometryComparator that this Geometry list uses for sorting.
      Returns:
      the pre-existing instance
    • setCamera

      public void setCamera(Camera cam)
      Set the camera that will be set on the geometry comparators via GeometryComparator.setCamera(com.jme3.renderer.Camera).
      Parameters:
      cam - Camera to use for sorting.
    • size

      public int size()
      Returns the number of elements in this GeometryList.
      Returns:
      Number of elements in the list
    • set

      public void set(int index, Geometry value)
      Sets the element at the given index.
      Parameters:
      index - The index to set
      value - The value
    • get

      public Geometry get(int index)
      Returns the element at the given index.
      Parameters:
      index - The index to lookup
      Returns:
      Geometry at the index
    • add

      public void add(Geometry g)
      Adds a geometry to the list. List size is doubled if there is no room.
      Parameters:
      g - The geometry to add.
    • clear

      public void clear()
      Resets list size to 0.
    • sort

      public void sort()
      Sorts the elements in the list according to their Comparator.
    • iterator

      public Iterator<Geometry> iterator()
      Specified by:
      iterator in interface Iterable<Geometry>