com.threerings.tudey.client.util
Class ShapeConfigElement

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.ShapeConfigElement
All Implemented Interfaces:
Compositable, Enqueueable, SceneElement, SceneObject, Intersectable, Tickable

public class ShapeConfigElement
extends SimpleSceneElement

Draws a shape from its config.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.opengl.scene.SceneElement
SceneElement.TickPolicy
 
Constructor Summary
ShapeConfigElement(GlContext ctx)
          Creates a new shape config element.
 
Method Summary
 Color4f getColor()
          Returns a reference to the outline color.
 boolean getIntersection(Ray3D ray, Vector3f result)
          Finds the intersection of a ray with this object and places it in the supplied vector (if it exists).
 void setConfig(ShapeConfig config, boolean outline)
          Sets the configuration of the shape to draw.
 
Methods inherited from class com.threerings.opengl.scene.SimpleSceneElement
getBounds, getTickPolicy, getUserObject, setInfluences, setTickPolicy, setTransform, setUserObject, tick, updateBounds, updateLastVisit, wasAdded, willBeRemoved
 
Methods inherited from class com.threerings.opengl.util.SimpleTransformable
enqueue, getTransform
 
Methods inherited from class com.threerings.opengl.util.SimpleRenderable
composite, getStates
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.threerings.opengl.compositor.Compositable
composite
 

Constructor Detail

ShapeConfigElement

public ShapeConfigElement(GlContext ctx)
Creates a new shape config element.

Method Detail

setConfig

public void setConfig(ShapeConfig config,
                      boolean outline)
Sets the configuration of the shape to draw.

Parameters:
outline - if true, draw the outline of the shape; if false, draw the solid form.

getColor

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


getIntersection

public boolean getIntersection(Ray3D ray,
                               Vector3f result)
Description copied from interface: Intersectable
Finds the intersection of a ray with this object and places it in the supplied vector (if it exists).

Specified by:
getIntersection in interface Intersectable
Overrides:
getIntersection in class SimpleSceneElement
Returns:
true if the ray intersected the object (in which case the result will contain the point of intersection), false otherwise.


Copyright © 2011. All Rights Reserved.