com.threerings.opengl.model
Class Articulated.Node

java.lang.Object
  extended by com.threerings.expr.SimpleScope
      extended by com.threerings.opengl.model.Articulated.Node
All Implemented Interfaces:
Scope, ScopeUpdateListener, Enqueueable
Direct Known Subclasses:
Articulated.MeshNode
Enclosing class:
Articulated

public static class Articulated.Node
extends SimpleScope
implements Enqueueable

A node in the model.


Field Summary
protected  Transform3D _boneTransform
          The bone transform, for nodes used as bones.
protected  ArticulatedConfig.Node _config
          The node configuration.
protected  GlContext _ctx
          The renderer context.
protected  Transform3D _localTransform
          The node's local transform.
protected  Transform3D _parentViewTransform
          A reference to the parent view transform.
protected  Transform3D _parentWorldTransform
          A reference to the parent world transform.
protected  Updater _updater
          An updater to apply after updating the view transform.
protected  Transform3D _viewTransform
          The node's view transform.
protected  Transform3D _worldTransform
          The node's world transform.
 int lastUpdate
          The value of the update counter at the last update (used when applying animation transforms to determine which transform is being applied first).
 float totalWeight
          The total weight of the animation transforms applied to this node.
 
Fields inherited from class com.threerings.expr.SimpleScope
_parentScope
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
protected Articulated.Node(GlContext ctx, Scope parentScope)
          Constructor for subclasses.
  Articulated.Node(GlContext ctx, Scope parentScope, ArticulatedConfig.Node config, Transform3D parentWorldTransform, Transform3D parentViewTransform)
          Creates a new node.
 
Method Summary
 void composite()
          Composites this node.
 void createSurfaces(GlContext ctx, ModelConfig.Imported.MaterialMapping[] materialMappings, Map<String,MaterialConfig> materialConfigs)
          Creates the surfaces of this node.
 void enqueue()
          Enqueues this object for rendering.
 Matrix4f getBoneMatrix()
          Returns this node's bone matrix (and flags it as a bone, if not already flagged).
 ArticulatedConfig.Node getConfig()
          Returns a reference to the configuration of this node.
 boolean getIntersection(Ray3D ray, Vector3f result)
          Checks for an intersection between the mesh in this node (if any) and the supplied ray.
 Transform3D getLocalTransform()
          Returns a reference to this node's local transform.
 Transform3D getParentViewTransform()
          Returns a reference to the parent view transform.
 Transform3D getParentWorldTransform()
          Returns a reference to the parent world transform.
 String getScopeName()
          Returns the name of this scope for purposes of qualification.
 Transform3D getViewTransform()
          Returns a reference to this node's view transform.
 Transform3D getWorldTransform()
          Returns a reference to this node's world transform.
 void setConfig(ArticulatedConfig.Node config, Transform3D parentWorldTransform, Transform3D parentViewTransform)
          Sets the configuration of this node.
 void setUpdater(Updater updater)
          Sets the updater to call after updating the view transform.
 void update()
          Updates the node for the current frame.
 
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

lastUpdate

public int lastUpdate
The value of the update counter at the last update (used when applying animation transforms to determine which transform is being applied first).


totalWeight

public float totalWeight
The total weight of the animation transforms applied to this node.


_ctx

protected GlContext _ctx
The renderer context.


_config

protected ArticulatedConfig.Node _config
The node configuration.


_parentWorldTransform

protected Transform3D _parentWorldTransform
A reference to the parent world transform.


_parentViewTransform

protected Transform3D _parentViewTransform
A reference to the parent view transform.


_localTransform

protected Transform3D _localTransform
The node's local transform.


_worldTransform

@Scoped
protected Transform3D _worldTransform
The node's world transform.


_viewTransform

@Scoped
protected Transform3D _viewTransform
The node's view transform.


_boneTransform

protected Transform3D _boneTransform
The bone transform, for nodes used as bones.


_updater

protected Updater _updater
An updater to apply after updating the view transform.

Constructor Detail

Articulated.Node

public Articulated.Node(GlContext ctx,
                        Scope parentScope,
                        ArticulatedConfig.Node config,
                        Transform3D parentWorldTransform,
                        Transform3D parentViewTransform)
Creates a new node.


Articulated.Node

protected Articulated.Node(GlContext ctx,
                           Scope parentScope)
Constructor for subclasses.

Method Detail

setConfig

public void setConfig(ArticulatedConfig.Node config,
                      Transform3D parentWorldTransform,
                      Transform3D parentViewTransform)
Sets the configuration of this node.


getConfig

public ArticulatedConfig.Node getConfig()
Returns a reference to the configuration of this node.


getParentWorldTransform

public Transform3D getParentWorldTransform()
Returns a reference to the parent world transform.


getParentViewTransform

public Transform3D getParentViewTransform()
Returns a reference to the parent view transform.


getLocalTransform

public Transform3D getLocalTransform()
Returns a reference to this node's local transform.


getWorldTransform

public Transform3D getWorldTransform()
Returns a reference to this node's world transform.


getViewTransform

public Transform3D getViewTransform()
Returns a reference to this node's view transform.


getBoneMatrix

public Matrix4f getBoneMatrix()
Returns this node's bone matrix (and flags it as a bone, if not already flagged).


setUpdater

public void setUpdater(Updater updater)
Sets the updater to call after updating the view transform.


createSurfaces

public void createSurfaces(GlContext ctx,
                           ModelConfig.Imported.MaterialMapping[] materialMappings,
                           Map<String,MaterialConfig> materialConfigs)
Creates the surfaces of this node.


update

public void update()
Updates the node for the current frame.


getIntersection

public boolean getIntersection(Ray3D ray,
                               Vector3f result)
Checks for an intersection between the mesh in this node (if any) and the supplied ray.


composite

public void composite()
Composites this node.


enqueue

public void enqueue()
Description copied from interface: Enqueueable
Enqueues this object for rendering.

Specified by:
enqueue in interface Enqueueable

getScopeName

public String getScopeName()
Description copied from interface: Scope
Returns the name of this scope for purposes of qualification. Can return null if qualified symbols cannot specifically address this scope.

Specified by:
getScopeName in interface Scope
Overrides:
getScopeName in class SimpleScope