com.jme.renderer
Class RenderQueue

java.lang.Object
  extended by com.jme.renderer.RenderQueue

public class RenderQueue
extends java.lang.Object

This optional class supports queueing of rendering states that are drawn when displayBackBuffer is called on the renderer. All spatials in the opaque bucket are rendered first in order closest to farthest. Then all spatials in the opaque bucket are rendered in order farthest to closest. Finally all spatials in the ortho bucket are rendered in ortho mode from highest to lowest Z order. As a user, you shouldn't need to use this class directly. All you'll need to do is call Spatial.setRenderQueueMode .

Author:
Joshua Slack, Jack Lindamood (javadoc + SpatialList only)
See Also:
Spatial.setRenderQueueMode(int)

Constructor Summary
RenderQueue(Renderer r)
          Creates a new render queue that will work with the given renderer.
 
Method Summary
 void addToQueue(Spatial s, int bucket)
          Add a given Spatial to the RenderQueue.
 void clearBuckets()
          clears all of the buckets.
 boolean isTwoPassTransparency()
           
 void renderBuckets()
          Renders the opaque, clone, transparent, and ortho buckets in that order.
 void setTwoPassTransparency(boolean enabled)
          Enables/Disables two pass transparency rendering.
 void swapBuckets()
          swaps all of the buckets with the back buckets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderQueue

public RenderQueue(Renderer r)
Creates a new render queue that will work with the given renderer.

Parameters:
r -
Method Detail

setTwoPassTransparency

public void setTwoPassTransparency(boolean enabled)
Enables/Disables two pass transparency rendering. If enabled, objects in the TRANSPARENT queue will be rendered in two passes. On the first pass, objects are rendered with front faces culled. On the second pass, objects are rendered with back faces culled. This allows complex transparent objects to be rendered whole without concern as to the order of the faces drawn.

Parameters:
enabled - set true to turn on two pass transparency rendering

isTwoPassTransparency

public boolean isTwoPassTransparency()
Returns:
true if two pass transparency rendering is enabled.

addToQueue

public void addToQueue(Spatial s,
                       int bucket)
Add a given Spatial to the RenderQueue. This is how jME adds data tothe render queue. As a user, in 99% of casees you'll want to use the function Spatail.setRenderQueueMode and let jME add the item to the queue itself.

Parameters:
s - Spatial to add.
bucket - A bucket type to add to.
See Also:
Spatial.setRenderQueueMode(int), Renderer.QUEUE_OPAQUE, Renderer.QUEUE_ORTHO, Renderer.QUEUE_TRANSPARENT

clearBuckets

public void clearBuckets()
clears all of the buckets.


swapBuckets

public void swapBuckets()
swaps all of the buckets with the back buckets.


renderBuckets

public void renderBuckets()
Renders the opaque, clone, transparent, and ortho buckets in that order.