com.threerings.tudey.shape
Class ShapeModel

java.lang.Object
  extended by com.threerings.expr.SimpleScope
      extended by com.threerings.opengl.model.Model.Implementation
          extended by com.threerings.tudey.shape.ShapeModel
All Implemented Interfaces:
Scope, ScopeUpdateListener, Compositable, Intersectable, Tickable

public class ShapeModel
extends Model.Implementation

Shape model implementation.


Field Summary
protected  ColorState _colorState
          The model's color state.
protected  ShapeModelConfig _config
          The model config.
protected  GlContext _ctx
          The application context.
protected  ShapeConfigElement _element
          The element used to render the shape.
protected  Transform3D _localTransform
          The local transform.
protected  Transform3D _parentViewTransform
          The parent view transform.
protected  Transform3D _parentWorldTransform
          The parent world transform.
 
Fields inherited from class com.threerings.expr.SimpleScope
_parentScope
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
ShapeModel(GlContext ctx, Scope parentScope, ShapeModelConfig config)
          Creates a new shape model implementation.
 
Method Summary
 void composite()
          Adds this object's Dependencys and Enqueueables to the compositor in preparation for rendering.
 void drawBounds()
          Draws the bounds of the model in immediate mode.
 Box getBounds()
          Returns a reference to the bounds of the model.
 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(ShapeModelConfig config)
          Sets the configuration of this model.
 void updateBounds()
          Updates the bounds of the model.
protected  void updateFromConfig()
          Updates the model to match its new or modified configuration.
 
Methods inherited from class com.threerings.opengl.model.Model.Implementation
attach, createAnimation, createSurface, createSurfaces, createSurfaces, detach, detachAll, getAnimation, getAnimations, getInfluenceFlags, getPlayingAnimations, getPointWorldTransform, getScopeName, getTickPolicy, hasCompleted, isImplementation, reset, setTickPolicy, tick, wasAdded, willBeRemoved
 
Methods inherited from class com.threerings.expr.SimpleScope
addListener, dispose, get, getParentScope, removeListener, scopeUpdated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_ctx

protected GlContext _ctx
The application context.


_config

protected ShapeModelConfig _config
The model config.


_element

protected ShapeConfigElement _element
The element used to render the shape.


_parentWorldTransform

@Bound(value="worldTransform")
protected Transform3D _parentWorldTransform
The parent world transform.


_parentViewTransform

@Bound(value="viewTransform")
protected Transform3D _parentViewTransform
The parent view transform.


_localTransform

@Bound
protected Transform3D _localTransform
The local transform.


_colorState

@Bound
protected ColorState _colorState
The model's color state.

Constructor Detail

ShapeModel

public ShapeModel(GlContext ctx,
                  Scope parentScope,
                  ShapeModelConfig config)
Creates a new shape model implementation.

Method Detail

setConfig

public void setConfig(ShapeModelConfig config)
Sets the configuration of this model.


getBounds

public Box getBounds()
Description copied from class: Model.Implementation
Returns a reference to the bounds of the model.

Overrides:
getBounds in class Model.Implementation

updateBounds

public void updateBounds()
Description copied from class: Model.Implementation
Updates the bounds of the model.

Overrides:
updateBounds in class Model.Implementation

drawBounds

public void drawBounds()
Description copied from class: Model.Implementation
Draws the bounds of the model in immediate mode.

Overrides:
drawBounds in class Model.Implementation

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 Model.Implementation
Returns:
true if the ray intersected the object (in which case the result will contain the point of intersection), false otherwise.

composite

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

Specified by:
composite in interface Compositable
Overrides:
composite in class Model.Implementation

updateFromConfig

protected void updateFromConfig()
Updates the model to match its new or modified configuration.