Class CamDepthSort

All Implemented Interfaces:
Serializable, Cloneable, Iterable<RenderState<?,?>>, Collection<RenderState<?,?>>, List<RenderState<?,?>>, RandomAccess, SequencedCollection<RenderState<?,?>>

public final class CamDepthSort extends SortMethod
CamDepthSort is a sorting method that sorts objects based on their depth values. Objects farther from the camera are placed before those closer to the camera.
Author:
Lehlogonolo Poole
See Also:
  • Constructor Details

    • CamDepthSort

      public CamDepthSort()
  • Method Details

    • clear

      public void clear()
      Clears the list and re-adds all non-dirty objects from the registered listeners.
      Specified by:
      clear in interface Collection<RenderState<?,?>>
      Specified by:
      clear in interface List<RenderState<?,?>>
      Overrides:
      clear in class ArrayList<RenderState<?,?>>
    • sort

      public void sort()
      Sorts the objects in the list based on their distance from the camera. Objects farther from the camera are placed before those closer to the camera.
      Specified by:
      sort in class SortMethod
    • calcDepth

      public static double calcDepth(@NotNull RenderState<?,?> drawable)