From fbb0bcff371bc2e8507363e1543794488ef8838c Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Tue, 18 Dec 2012 05:43:09 +0000 Subject: [PATCH] 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 --- .../com/jme3/renderer/queue/RenderQueue.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/engine/src/core/com/jme3/renderer/queue/RenderQueue.java b/engine/src/core/com/jme3/renderer/queue/RenderQueue.java index 66ea4ad4c..98323c7a3 100644 --- a/engine/src/core/com/jme3/renderer/queue/RenderQueue.java +++ b/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