Package com.simsilica.lemur
Class LayerComparator
java.lang.Object
com.simsilica.lemur.LayerComparator
- All Implemented Interfaces:
GeometryComparator
,Comparator<Geometry>
Sorts geometry based on an included "layer" user data,
accumulating an effective layer by walking up the
scene graph back to root. Layers are parent-local layers
and not global layers. In other words, they only control
the sorting of children. This approach is more useful in
a GUI environment where UI elements are grouped in
scene graph hierarchies already.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLayerComparator
(GeometryComparator delegate) LayerComparator
(GeometryComparator delegate, int bias) -
Method Summary
Modifier and TypeMethodDescriptionprotected float
static void
int
float
static Integer
static void
resetLayer
(Spatial s, int layer) void
Set the camera to use for sorting.static void
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
LAYER
- See Also:
-
EFFECTIVE_LAYER
- See Also:
-
-
Constructor Details
-
LayerComparator
-
LayerComparator
-
-
Method Details
-
setLayer
-
resetLayer
-
getLayer
-
clearEffectiveLayer
-
setCamera
Description copied from interface:GeometryComparator
Set the camera to use for sorting.- Specified by:
setCamera
in interfaceGeometryComparator
- Parameters:
cam
- The camera to use for sorting
-
calculateEffectiveLayer
-
getLayer
-
compare
- Specified by:
compare
in interfaceComparator<Geometry>
-
toString
-