org.jagatoo.loaders.models.bsp
Class BSPClusterManager

java.lang.Object
  extended by org.jagatoo.loaders.models.bsp.BSPClusterManager
All Implemented Interfaces:
BSPVisibilityUpdater

public class BSPClusterManager
extends java.lang.Object
implements BSPVisibilityUpdater

This class is used to manage the visibility of all the BSP clusters.


Field Summary
protected  java.util.BitSet shapeBitset
           
 
Constructor Summary
BSPClusterManager(BSPClusterManager template)
           
BSPClusterManager(BSPVisData bspVisData, int[][][] clusterLeafs, int[] leafToCluster, float[] planes, int[] nodes, java.util.BitSet shapeBitset)
           
 
Method Summary
static BSPClusterManager create(BSPScenePrototype prototype, java.util.BitSet faceBitset)
          Creates a BSPClusterManager from the visdata contained in the prototype.
 java.util.BitSet getBitSet()
           
 boolean isPVSUsed()
           
 void setPVSUsage(boolean enabled)
          Enables or disables PVS usage.
 boolean updateVisibility(org.openmali.vecmath2.Matrix4f cameraTransform)
          Disables geometry that is invisible according to the PVS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shapeBitset

protected final java.util.BitSet shapeBitset
Constructor Detail

BSPClusterManager

public BSPClusterManager(BSPVisData bspVisData,
                         int[][][] clusterLeafs,
                         int[] leafToCluster,
                         float[] planes,
                         int[] nodes,
                         java.util.BitSet shapeBitset)

BSPClusterManager

public BSPClusterManager(BSPClusterManager template)
Method Detail

getBitSet

public final java.util.BitSet getBitSet()
Specified by:
getBitSet in interface BSPVisibilityUpdater

setPVSUsage

public void setPVSUsage(boolean enabled)
Enables or disables PVS usage.

Parameters:
enabled - if true the PVS is used to disable hidden geometry, false and everything is enabled

isPVSUsed

public boolean isPVSUsed()
Returns:
true, if the PVS is used to disable hidden geometry. false, and everything is enabled

updateVisibility

public boolean updateVisibility(org.openmali.vecmath2.Matrix4f cameraTransform)
Disables geometry that is invisible according to the PVS

Specified by:
updateVisibility in interface BSPVisibilityUpdater
Parameters:
camPos - the position of the camera
Returns:
true, if PVS has changed.

create

public static BSPClusterManager create(BSPScenePrototype prototype,
                                       java.util.BitSet faceBitset)
Creates a BSPClusterManager from the visdata contained in the prototype.

Parameters:
prototype -
faceBitset -