com.threerings.tudey.client.util
Class ShapeSceneElement

java.lang.Object
  extended by com.threerings.opengl.util.SimpleRenderable
      extended by com.threerings.opengl.util.SimpleTransformable
          extended by com.threerings.opengl.scene.SimpleSceneElement
              extended by com.threerings.tudey.client.util.ShapeSceneElement
All Implemented Interfaces:
Compositable, Enqueueable, SceneElement, SceneObject, Intersectable, Tickable

public class ShapeSceneElement
extends SimpleSceneElement

Draws a shape in the scene.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.opengl.scene.SceneElement
SceneElement.TickPolicy
 
Field Summary
protected  boolean _outline
          Whether or not to draw the shape in outline mode.
protected  Shape _shape
          The shape to draw, or null for none.
 
Fields inherited from class com.threerings.opengl.scene.SimpleSceneElement
_bounds, _influences, _lastVisit, _nbounds, _scene, _tickPolicy, _userObject
 
Fields inherited from class com.threerings.opengl.util.SimpleTransformable
_transform
 
Fields inherited from class com.threerings.opengl.util.SimpleRenderable
_batch, _ctx, _priority, _queue
 
Constructor Summary
ShapeSceneElement(GlContext ctx, boolean outline)
          Creates a new shape scene element.
 
Method Summary
protected  void computeBounds(Box result)
          Computes the bounds of the element and places them in the provided result object.
protected  RenderState[] createStates()
          Creates the state set for this object.
protected  void draw()
          Draws the geometry in immediate mode.
 Color4f getColor()
          Returns a reference to the color.
 Shape getShape()
          Returns a reference to the shape being drawn.
 void setShape(Shape shape)
          Sets the shape to draw.
 
Methods inherited from class com.threerings.opengl.scene.SimpleSceneElement
boundsDidChange, boundsWillChange, getBounds, getIntersection, getLocalBounds, getTickPolicy, getUserObject, setInfluences, setTickPolicy, setTransform, setUserObject, tick, updateBounds, updateLastVisit, wasAdded, willBeRemoved
 
Methods inherited from class com.threerings.opengl.util.SimpleTransformable
enqueue, getCenter, getTransform
 
Methods inherited from class com.threerings.opengl.util.SimpleRenderable
composite, createBatch, getStates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.threerings.opengl.compositor.Compositable
composite
 

Field Detail

_shape

protected Shape _shape
The shape to draw, or null for none.


_outline

protected boolean _outline
Whether or not to draw the shape in outline mode.

Constructor Detail

ShapeSceneElement

public ShapeSceneElement(GlContext ctx,
                         boolean outline)
Creates a new shape scene element.

Method Detail

setShape

public void setShape(Shape shape)
Sets the shape to draw.


getShape

public Shape getShape()
Returns a reference to the shape being drawn.


getColor

public Color4f getColor()
Returns a reference to the color.


createStates

protected RenderState[] createStates()
Description copied from class: SimpleRenderable
Creates the state set for this object.

Overrides:
createStates in class SimpleTransformable

computeBounds

protected void computeBounds(Box result)
Description copied from class: SimpleSceneElement
Computes the bounds of the element and places them in the provided result object. The default implementation simply transforms the bounds returned by SimpleSceneElement.getLocalBounds().

Overrides:
computeBounds in class SimpleSceneElement

draw

protected void draw()
Description copied from class: SimpleRenderable
Draws the geometry in immediate mode.

Overrides:
draw in class SimpleRenderable