com.threerings.opengl.scene
Class HashScene

java.lang.Object
  extended by com.threerings.expr.DynamicScope
      extended by com.threerings.opengl.scene.Scene
          extended by com.threerings.opengl.scene.HashScene
All Implemented Interfaces:
Scope, ScopeUpdateListener, Compositable, Tickable

public class HashScene
extends Scene

A scene that uses a hybrid spatial hashing/octree scheme to store scene elements.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.opengl.scene.Scene
Scene.Transient
 
Field Summary
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
HashScene(GlContext ctx, float granularity, int levels)
          Creates a new hash scene.
HashScene(GlContext ctx, float granularity, int levels, int sources)
          Creates a new hash scene.
 
Method Summary
 void boundsDidChange(SceneElement element)
          Notes that the specified scene element's bounds have changed.
 void boundsDidChange(SceneInfluence influence)
          Notes that the specified influence's bounds have changed.
 void boundsDidChange(ViewerEffect effect)
          Notes that the specified effect's bounds have changed.
 void boundsWillChange(SceneElement element)
          Notes that the specified scene element's bounds are about to change.
 void boundsWillChange(SceneInfluence influence)
          Notes that the specified influence's bounds are about to change.
 void boundsWillChange(ViewerEffect effect)
          Notes that the specified effect's bounds are about to change.
 void composite()
          Adds this object's Dependencys and Enqueueables to the compositor in preparation for rendering.
 void getEffects(Box bounds, Collection<ViewerEffect> results)
          Retrieves all viewer effects whose bounds intersect the provided region.
 void getElements(Box bounds, Collection<SceneElement> results)
          Retrieves all scene elements whose bounds intersect the provided region.
 void getInfluences(Box bounds, Collection<SceneInfluence> results)
          Retrieves all scene influences whose bounds intersect the provided region.
 SceneElement getIntersection(Ray3D ray, Vector3f location, Predicate<? super SceneElement> filter)
          Checks for an intersection between the provided ray and the contents of the scene.
 
Methods inherited from class com.threerings.opengl.scene.Scene
add, add, add, addAll, clearEffects, dispose, dumpViewerEffects, getAlwaysTickCount, getFromTransientPool, getIntersection, getUpdateInfluencesCount, getViewerEffectCount, getVisibleTickCount, remove, remove, remove, remove, removeAll, removeAll, returnToTransientPool, spawnTransient, tick, tickPolicyDidChange, tickPolicyWillChange
 
Methods inherited from class com.threerings.expr.DynamicScope
addListener, endCompoundUpdate, get, getParentScope, getScopeName, put, remove, removeListener, scopeUpdated, setParentScope, startCompoundUpdate, wasUpdated
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashScene

public HashScene(GlContext ctx,
                 float granularity,
                 int levels)
Creates a new hash scene.

Parameters:
granularity - the size of the top-level cells.
levels - the (maximum) number of octree levels.

HashScene

public HashScene(GlContext ctx,
                 float granularity,
                 int levels,
                 int sources)
Creates a new hash scene.

Parameters:
granularity - the size of the top-level cells.
levels - the (maximum) number of octree levels.
sources - the number of simultaneous sound sources to allow.
Method Detail

composite

public void composite()
Description copied from interface: Compositable
Adds this object's Dependencys and Enqueueables to the compositor in preparation for rendering.


getIntersection

public SceneElement getIntersection(Ray3D ray,
                                    Vector3f location,
                                    Predicate<? super SceneElement> filter)
Description copied from class: Scene
Checks for an intersection between the provided ray and the contents of the scene.

Specified by:
getIntersection in class Scene
location - a vector to populate with the location of the intersection, if any.
filter - a predicate to use in filtering the results of the test.
Returns:
a reference to the first element intersected by the ray, or null for none.

getElements

public void getElements(Box bounds,
                        Collection<SceneElement> results)
Description copied from class: Scene
Retrieves all scene elements whose bounds intersect the provided region.

Specified by:
getElements in class Scene
results - a list to hold the results of the search.

getInfluences

public void getInfluences(Box bounds,
                          Collection<SceneInfluence> results)
Description copied from class: Scene
Retrieves all scene influences whose bounds intersect the provided region.

Specified by:
getInfluences in class Scene

getEffects

public void getEffects(Box bounds,
                       Collection<ViewerEffect> results)
Description copied from class: Scene
Retrieves all viewer effects whose bounds intersect the provided region.

Specified by:
getEffects in class Scene

boundsWillChange

public void boundsWillChange(SceneElement element)
Description copied from class: Scene
Notes that the specified scene element's bounds are about to change. Will be followed by a call to Scene.boundsDidChange(SceneElement) when the change has been effected.

Overrides:
boundsWillChange in class Scene

boundsDidChange

public void boundsDidChange(SceneElement element)
Description copied from class: Scene
Notes that the specified scene element's bounds have changed.

Overrides:
boundsDidChange in class Scene

boundsWillChange

public void boundsWillChange(SceneInfluence influence)
Description copied from class: Scene
Notes that the specified influence's bounds are about to change. Will be followed by a call to Scene.boundsDidChange(SceneInfluence) when the change has been effected.

Overrides:
boundsWillChange in class Scene

boundsDidChange

public void boundsDidChange(SceneInfluence influence)
Description copied from class: Scene
Notes that the specified influence's bounds have changed.

Overrides:
boundsDidChange in class Scene

boundsWillChange

public void boundsWillChange(ViewerEffect effect)
Description copied from class: Scene
Notes that the specified effect's bounds are about to change. Will be followed by a call to Scene.boundsDidChange(ViewerEffect) when the change has been effected.

Overrides:
boundsWillChange in class Scene

boundsDidChange

public void boundsDidChange(ViewerEffect effect)
Description copied from class: Scene
Notes that the specified effect's bounds have changed.

Overrides:
boundsDidChange in class Scene


Copyright © 2011. All Rights Reserved.