com.threerings.opengl.scene
Class ViewerEffect

java.lang.Object
  extended by com.threerings.util.ShallowObject
      extended by com.threerings.opengl.scene.ViewerEffect
All Implemented Interfaces:
SceneObject
Direct Known Subclasses:
BackgroundColorEffect

public abstract class ViewerEffect
extends ShallowObject
implements SceneObject

Base class for things in the scene that affect the viewer.


Constructor Summary
ViewerEffect()
           
 
Method Summary
 void activate(Scene scene)
          Notes that the effect is now acting on the viewer.
 void deactivate()
          Notes that the effect is no longer acting on the viewer.
 Color4f getBackgroundColor()
          Returns the background color associated with this effect, or null for none.
 Box getBounds()
          Returns a reference to the bounds of the object.
 boolean hasCompleted()
          Determines whether the effect has completed.
 boolean omitWhileLoading()
          A hint indicating taht we should omit this effect while loading (used for sounds, to prevent them from playing until we're fully loaded).
 void reset()
          Resets the effect.
 void update()
          Called once per frame while the effect is active.
 boolean updateLastVisit(int visit)
          Checks and updates the last visit value.
 
Methods inherited from class com.threerings.util.ShallowObject
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewerEffect

public ViewerEffect()
Method Detail

getBackgroundColor

public Color4f getBackgroundColor()
Returns the background color associated with this effect, or null for none.


activate

public void activate(Scene scene)
Notes that the effect is now acting on the viewer.


deactivate

public void deactivate()
Notes that the effect is no longer acting on the viewer.


update

public void update()
Called once per frame while the effect is active.


hasCompleted

public boolean hasCompleted()
Determines whether the effect has completed.


reset

public void reset()
Resets the effect.


omitWhileLoading

public boolean omitWhileLoading()
A hint indicating taht we should omit this effect while loading (used for sounds, to prevent them from playing until we're fully loaded).


getBounds

public Box getBounds()
Description copied from interface: SceneObject
Returns a reference to the bounds of the object.

Specified by:
getBounds in interface SceneObject

updateLastVisit

public boolean updateLastVisit(int visit)
Description copied from interface: SceneObject
Checks and updates the last visit value. This is used to determine when we have visited (e.g., rendered) the object without having to clear a flag for all objects before performing the operation. Instead, we use a unique visitation id for each operation and assume that any object with that id has been visited already.

Specified by:
updateLastVisit in interface SceneObject
Returns:
true if the last visit value was not equal to the value provided (and has now been set to that value), false if the object had already been visited during the current operation.


Copyright © 2011. All Rights Reserved.