j3d.org Aviatrix3D

org.j3d.aviatrix3d.pipeline
Class SimpleFrustumCullStage

java.lang.Object
  extended byorg.j3d.aviatrix3d.pipeline.SimpleFrustumCullStage
All Implemented Interfaces:
CullStage

public class SimpleFrustumCullStage
extends java.lang.Object
implements CullStage

Handles the scenegraph maintenance and culling operations.

The culling phase generates a list of nodes to render. A future optimization will sort the render list by OGL state.

By default, the implementation will walk into shape3Ds looking for any offscreen textures to be rendered. If you know that you do not have any in the scene, then you can set an internal flag to not look for them, thus achieving a simple performance boost.

Version:
$Revision: 1.5 $
Author:
Alan Hudson

Constructor Summary
SimpleFrustumCullStage()
          Create a basic instance of this class with the list assuming there are no off-screen buffers in use for the initial internal setup.
SimpleFrustumCullStage(int numSurfaces)
          Create a basic instance of this class with the list initial internal setup for the given number of renderable surfaces.
 
Method Summary
 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 setOffscreenCheckEnabled(boolean state)
          Set the flag for whether to check for offscreen textures or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFrustumCullStage

public SimpleFrustumCullStage()
Create a basic instance of this class with the list assuming there are no off-screen buffers in use for the initial internal setup.


SimpleFrustumCullStage

public SimpleFrustumCullStage(int numSurfaces)
Create a basic instance of this class with the list initial internal setup for the given number of renderable surfaces. The size is just an initial esstimate, and is used for optimisation purposes to prevent frequent array reallocations internally. As such, the number does not have to be perfect, just good enough.

Parameters:
numSurfaces - Total number of surfaces to prepare rendering for
Method Detail

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.

Specified by:
cull in interface CullStage
Parameters:
scene - The scene instance to cull
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.

Specified by:
setCulledGeometryReceiver in interface CullStage
Parameters:
sgr - The receiver instance to add or null

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.

Specified by:
setOffscreenCheckEnabled in interface CullStage
Parameters:
state - true if offscreen textures should be looked for

isOffscreenCheckEnabled

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

Specified by:
isOffscreenCheckEnabled in interface CullStage
Returns:
true if the checking is being performed

j3d.org Aviatrix3D

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