Ver Fonte

Added an accessor for accessing the current GeometryComparator
for a bucket.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10033 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

PSp..om há 12 anos atrás
pai
commit
fbb0bcff37
1 ficheiros alterados com 22 adições e 1 exclusões
  1. 22 1
      engine/src/core/com/jme3/renderer/queue/RenderQueue.java

+ 22 - 1
engine/src/core/com/jme3/renderer/queue/RenderQueue.java

@@ -163,7 +163,7 @@ public class RenderQueue {
 
     /**
      *  Sets a different geometry comparator for the specified bucket, one
-     *  of Gui, Opaque, Sky, or Transparent.  The GeometryComparators are
+     *  of Gui, Opaque, Sky, Transparent, or Translucent.  The GeometryComparators are
      *  used to sort the accumulated list of geometries before actual rendering
      *  occurs.
      *
@@ -208,6 +208,27 @@ public class RenderQueue {
         }
     }
 
+    /**
+     *  Returns the current GeometryComparator used by the specified bucket,
+     *  one of Gui, Opaque, Sky, Transparent, or Translucent.
+     */
+    public GeometryComparator getGeometryComparator(Bucket bucket) {
+        switch (bucket) {
+            case Gui:
+                return guiList.getComparator();
+            case Opaque:
+                return opaqueList.getComparator();
+            case Sky:
+                return skyList.getComparator();
+            case Transparent:
+                return transparentList.getComparator();
+            case Translucent:
+                return translucentList.getComparator();
+            default:
+                throw new UnsupportedOperationException("Unknown bucket type: " + bucket);
+        }
+    }
+
     /**
      * Adds a geometry to a shadow bucket.
      * Note that this operation is done automatically by the