j3d.org Aviatrix3D

org.j3d.aviatrix3d
Interface CullStage

All Known Implementing Classes:
FrustumCullStage, GenericCullStage, NullCullStage, SimpleFrustumCullStage

public interface CullStage

Handles the scenegraph per-frame culling operations.

The culling phase generates a list of leaf nodes to render by removing non-required sections of the scene graph. How this culling is performed (if at all) is dependent on the implementation of this class. All that is defined is a complete scene graph as input, and a grouped set of nodes based on what must be kept together from a rendering perspective. Two typical culling approaches are view frustum and BSP. Others may also be implemented dependent on the application domain. Implementations may also work concepts that are not 3D geometry-based, such as audio and haptics.

The culling stage is responsible for looking at the offscreen renderable surfaces as well as the main screen. Since most scenes will not require any offscreen rendering, convenience methods are defined to allow the user to turn on/off these checks. Offscreen rendering, and the checking for extra renderables can be a huge CPU hog so it is advisable to make sure that it is turned off if you don't need it. An ideal implementation will be able to handle dynamically switching between the two states between frames without the need to restart.

Output is to be sent to the registered listener.

Version:
$Revision: 1.9 $
Author:
Justin Couch

Method Summary
 void cull(Layer[] layers, int numLayers, int buffer)
          Update and cull the scenegraph defined by a set of layers.
 void cull(Scene scene, int buffer)
          Update and cull the scenegraph.
 boolean isOffscreenCheckEnabled()
          Find out what the current offscreen check state is.
 void setCulledGeometryReceiver(CulledGeometryReceiver sgr)
          Register a reciever for the output of the sorter.
 void setEyePointOffset(float x, float y, float z)
          Set the eyepoint offset from the centre position.
 void setOffscreenCheckEnabled(boolean state)
          Set the flag for whether to check for offscreen textures or not.
 void setScreenOrientation(float x, float y, float z, float a)
          Set the orientation of this screen relative to the user's normal view direction.
 

Method Detail

setOffscreenCheckEnabled

public void setOffscreenCheckEnabled(boolean state)
Set the flag for whether to check for offscreen textures or not. By default, this flag is set to true.

Parameters:
state - true if offscreen textures should be looked for

isOffscreenCheckEnabled

public boolean isOffscreenCheckEnabled()
Find out what the current offscreen check state is.

Returns:
true if the checking is being performed

cull

public void cull(Scene scene,
                 int buffer)
Update and cull the scenegraph. This generates an ordered list of nodes to render. It will not return until the culling is complete.

Parameters:
scene - The scene instance to cull
buffer - The buffer ID to use to output the data to when multi-threaded

cull

public void cull(Layer[] layers,
                 int numLayers,
                 int buffer)
Update and cull the scenegraph defined by a set of layers. This generates an ordered list of nodes to render. It will not return until the culling is complete.

Parameters:
layers - The collection of layers, in order, to render
numLayers - The number of valid layers to use
buffer - The buffer ID to use to output the data to when multi-threaded

setCulledGeometryReceiver

public void setCulledGeometryReceiver(CulledGeometryReceiver sgr)
Register a reciever for the output of the sorter. If the value is null, it will clear the currently set receiver.

Parameters:
sgr - The receiver instance to add or null

setEyePointOffset

public void setEyePointOffset(float x,
                              float y,
                              float z)
Set the eyepoint offset from the centre position. This is used to model offset view frustums, such as multiple displays or a powerwall. This method will be called with the appropriate values from the RenderPipeline that this culler is inserted into.

Parameters:
x - The x axis offset
y - The y axis offset
z - The z axis offset

setScreenOrientation

public void setScreenOrientation(float x,
                                 float y,
                                 float z,
                                 float a)
                          throws java.lang.IllegalArgumentException
Set the orientation of this screen relative to the user's normal view direction. The normal orientation of the screen is along the negative Z axis. This method provides and axis-angle reorientation of that direction to one that is facing the screen. Typically this will just involve a rotation around the Y axis of some amount (45 and 90 deg being the most common used in walls and caves). This method will be called with the appropriate values from the RenderPipeline that this culler is inserted into.

Parameters:
x - The x axis component
y - The y axis component
z - The z axis component
a - The angle to rotate around the axis in radians
Throws:
java.lang.IllegalArgumentException - The length of the axis is zero

j3d.org Aviatrix3D

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - j3d.org