com.threerings.opengl.scene
Class SceneInfluenceSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<T>
          extended by com.threerings.util.AbstractIdentityHashSet<SceneInfluence>
              extended by com.threerings.opengl.scene.SceneInfluenceSet
All Implemented Interfaces:
Iterable<SceneInfluence>, Collection<SceneInfluence>, Set<SceneInfluence>

public class SceneInfluenceSet
extends AbstractIdentityHashSet<SceneInfluence>

A set of scene influences.


Field Summary
protected static int MAX_LIGHTS
          The maximum number of lights we allow in a set.
protected static Projection[] NO_PROJECTIONS
          Reusable empty projections array.
 
Fields inherited from class com.threerings.util.AbstractIdentityHashSet
_map
 
Constructor Summary
SceneInfluenceSet()
           
 
Method Summary
protected  boolean canReuse(LightState state, ArrayList<Light> nlights)
          Determines whether we can reuse the specified state, given the provided new list of lights.
protected  boolean canReuse(Map<String,Object> definitions, Map<String,Object> ndefs)
          Determines whether we can reuse the specified definitions.
protected  boolean canReuse(Projection[] projections, ArrayList<Projection> nprojs)
          Determines whether we can reuse the specified projections.
 Map<String,Object> getDefinitions(Map<String,Object> definitions)
          Returns the set of definitions for this influence set.
 FogState getFogState(Box bounds, FogState state)
          Returns the fog state for this influence set.
 LightState getLightState(Box bounds, LightState state)
          Returns the light state for this influence set.
 Projection[] getProjections(Projection[] projections)
          Returns the set of projections for this influence set.
 
Methods inherited from class com.threerings.util.AbstractIdentityHashSet
add, clear, contains, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, isEmpty, retainAll, toArray, toArray
 

Field Detail

MAX_LIGHTS

protected static final int MAX_LIGHTS
The maximum number of lights we allow in a set.

See Also:
Constant Field Values

NO_PROJECTIONS

protected static final Projection[] NO_PROJECTIONS
Reusable empty projections array.

Constructor Detail

SceneInfluenceSet

public SceneInfluenceSet()
Method Detail

getFogState

public FogState getFogState(Box bounds,
                            FogState state)
Returns the fog state for this influence set.

Parameters:
bounds - the bounds used to resolve conflicts.
state - an existing state to reuse, if possible.

getLightState

public LightState getLightState(Box bounds,
                                LightState state)
Returns the light state for this influence set.

Parameters:
bounds - the bounds used to resolve conflicts.
state - an existing state to reuse, if possible.

getProjections

public Projection[] getProjections(Projection[] projections)
Returns the set of projections for this influence set.

Parameters:
projections - an existing array to reuse, if possible.

getDefinitions

public Map<String,Object> getDefinitions(Map<String,Object> definitions)
Returns the set of definitions for this influence set.

Parameters:
definitions - an existing map to reuse, if possible.

canReuse

protected boolean canReuse(LightState state,
                           ArrayList<Light> nlights)
Determines whether we can reuse the specified state, given the provided new list of lights.


canReuse

protected boolean canReuse(Projection[] projections,
                           ArrayList<Projection> nprojs)
Determines whether we can reuse the specified projections.


canReuse

protected boolean canReuse(Map<String,Object> definitions,
                           Map<String,Object> ndefs)
Determines whether we can reuse the specified definitions.