|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.expr.SimpleScope
com.threerings.opengl.model.Model.Implementation
com.threerings.opengl.model.Articulated
public class Articulated
An articulated model implementation.
| Nested Class Summary | |
|---|---|
static class |
Articulated.MeshNode
A node that contains a (visible and/or collision) mesh. |
static class |
Articulated.Node
A node in the model. |
| Field Summary | |
|---|---|
protected Animation[] |
_animations
The animations. |
protected HashMap<String,Animation> |
_animationsByName
Maps animation names to animations. |
protected Box |
_bounds
The bounds of the model. |
protected boolean |
_completed
If true, the model has completed. |
protected ArticulatedConfig |
_config
The model configuration. |
protected Model[] |
_configAttachments
The attachments created from the configuration. |
protected GlContext |
_ctx
The application context. |
protected int |
_influenceFlags
Flags indicating which influences can affect the model. |
protected Transform3D |
_localTransform
The local transform. |
protected Box |
_nbounds
Holds the bounds of the model when updating. |
protected Articulated.Node[] |
_nodes
The model nodes, in the order of a preorder depth-first traversal. |
protected HashMap<String,Articulated.Node> |
_nodesByName
Maps node names to nodes. |
protected Function |
_parentGetBoneMatrix
The parent implementation of getBoneMatrix(java.lang.String). |
protected Transform3D |
_parentViewTransform
The parent view transform. |
protected Transform3D |
_parentWorldTransform
The parent world transform. |
protected ArrayList<Animation> |
_playing
The animations currently being played, sorted by decreasing priority. |
protected Animation[] |
_playingArray
Holds the playing animations during the tick. |
protected boolean |
_started
Whether or not we have started the automatic animations. |
protected Surface[] |
_surfaces
The skinned surfaces. |
protected SceneElement.TickPolicy |
_tickPolicy
The model's tick policy. |
protected TransformState |
_transformState
The shared transform state. |
protected int |
_update
Incremented on each call to updateTransforms() and used to determine which nodes
have been manipulated by animations on the current update. |
protected ArrayList<Model> |
_userAttachments
User attachments (their parent scopes are the nodes to which they're attached). |
protected Transform3D |
_viewTransform
The view transform. |
protected Transform3D |
_worldTransform
The world transform. |
| Fields inherited from class com.threerings.expr.SimpleScope |
|---|
_parentScope |
| Fields inherited from interface com.threerings.expr.Scope |
|---|
EPOCH, NOW |
| Constructor Summary | |
|---|---|
Articulated(GlContext ctx,
Scope parentScope,
ArticulatedConfig config)
Creates a new articulated implementation. |
|
| Method Summary | |
|---|---|
protected void |
animationStarted(Animation animation,
float overrideBlendOut)
Notes that an animation has started. |
protected void |
animationStopped(Animation animation,
boolean completed)
Notes that an animation has stopped. |
void |
attach(String point,
Model model,
boolean replace)
Attaches the specified model at the given point. |
void |
composite()
Adds this object's Dependencys and Enqueueables to the compositor in
preparation for rendering. |
Animation |
createAnimation()
Creates an animation for the model or returns null if not supported. |
void |
detach(Model model)
Detaches an attached model. |
protected void |
detachAll(Articulated.Node node)
Detaches all models attached to the specified node. |
void |
detachAll(String point)
Detaches any models attached to the specified point. |
void |
drawBounds()
Draws the bounds of the model in immediate mode. |
void |
enqueue()
Enqueues this object for rendering. |
Animation |
getAnimation(String name)
Retrieves an animation by name. |
Animation[] |
getAnimations()
Returns the model's list of animations. |
protected Articulated.Node |
getAttachmentNode(String name)
Returns a reference to the node with the specified name, logging a warning and returning null if no such node exists. |
Matrix4f |
getBoneMatrix(String name)
Returns a reference to the bone matrix for the named node. |
Box |
getBounds()
Returns a reference to the bounds of the model. |
int |
getInfluenceFlags()
Returns a set of flags indicating the types of influences that affect 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). |
Articulated.Node |
getNode(String name)
Returns a reference to the node with the specified name. |
List<Animation> |
getPlayingAnimations()
Returns a list of all animations currently playing. |
Transform3D |
getPointWorldTransform(String point)
Returns a reference to the world transform of the given point. |
protected boolean |
getSkinIntersection(Ray3D ray,
Vector3f result)
Checks for an intersection with the skin mesh. |
SceneElement.TickPolicy |
getTickPolicy()
Returns the tick policy of the model. |
boolean |
hasCompleted()
Determines whether the model (such as a transient effect) has completed. |
protected static SceneElement.TickPolicy |
mergePolicy(SceneElement.TickPolicy policy,
Model model)
Returns the policy covering both the current policy and that of the specified model. |
void |
reset()
Resets the state of this model. |
void |
setConfig(ArticulatedConfig config)
Sets the configuration of this model. |
void |
tick(float elapsed)
Updates the state of this object based on the elapsed time in seconds. |
void |
updateBounds()
Updates the bounds of the model. |
protected void |
updateFromConfig()
Updates the model to match its new or modified configuration. |
protected void |
updateTransforms()
Updates the node transforms based on the current animation state. |
void |
wasAdded()
Notes that the model was added to a scene. |
void |
willBeRemoved()
Notes that the model will be removed from the scene. |
| Methods inherited from class com.threerings.opengl.model.Model.Implementation |
|---|
createSurface, createSurfaces, createSurfaces, getScopeName, isImplementation, setTickPolicy |
| 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 |
|---|
protected GlContext _ctx
protected ArticulatedConfig _config
protected Articulated.Node[] _nodes
protected HashMap<String,Articulated.Node> _nodesByName
protected Surface[] _surfaces
protected Animation[] _animations
protected HashMap<String,Animation> _animationsByName
protected Model[] _configAttachments
@Bound(value="worldTransform") protected Transform3D _parentWorldTransform
@Bound(value="viewTransform") protected Transform3D _parentViewTransform
@Bound(value="getBoneMatrix") protected Function _parentGetBoneMatrix
getBoneMatrix(java.lang.String).
@Bound protected Transform3D _localTransform
@Scoped protected Transform3D _worldTransform
@Scoped protected Transform3D _viewTransform
@Scoped protected TransformState _transformState
protected int _influenceFlags
@Scoped protected Box _bounds
@Scoped protected Box _nbounds
protected SceneElement.TickPolicy _tickPolicy
protected ArrayList<Model> _userAttachments
protected boolean _started
protected ArrayList<Animation> _playing
protected Animation[] _playingArray
protected int _update
updateTransforms() and used to determine which nodes
have been manipulated by animations on the current update.
protected boolean _completed
| Constructor Detail |
|---|
public Articulated(GlContext ctx,
Scope parentScope,
ArticulatedConfig config)
| Method Detail |
|---|
public void setConfig(ArticulatedConfig config)
@Scoped public Matrix4f getBoneMatrix(String name)
@Scoped public Articulated.Node getNode(String name)
public void enqueue()
Enqueueable
enqueue in interface Enqueueablepublic Transform3D getPointWorldTransform(String point)
Model.Implementation
getPointWorldTransform in class Model.Implementation
public void attach(String point,
Model model,
boolean replace)
Model.Implementation
attach in class Model.Implementationreplace - if true, replace any existing attachments at the point.public void detach(Model model)
Model.Implementation
detach in class Model.Implementationpublic void detachAll(String point)
Model.Implementation
detachAll in class Model.Implementationpublic List<Animation> getPlayingAnimations()
Model.Implementation
getPlayingAnimations in class Model.Implementationpublic Animation getAnimation(String name)
Model.Implementation
getAnimation in class Model.Implementationpublic Animation[] getAnimations()
Model.Implementation
getAnimations in class Model.Implementationpublic Animation createAnimation()
Model.Implementationnull if not supported.
createAnimation in class Model.Implementationpublic boolean hasCompleted()
Model.Implementation
hasCompleted in class Model.Implementationpublic void reset()
Model.Implementation
reset in class Model.Implementationpublic int getInfluenceFlags()
Model.Implementation
getInfluenceFlags in class Model.Implementationpublic Box getBounds()
Model.Implementation
getBounds in class Model.Implementationpublic void updateBounds()
Model.Implementation
updateBounds in class Model.Implementationpublic void drawBounds()
Model.Implementation
drawBounds in class Model.Implementationpublic SceneElement.TickPolicy getTickPolicy()
Model.Implementation
getTickPolicy in class Model.Implementationpublic void wasAdded()
Model.Implementation
wasAdded in class Model.Implementationpublic void willBeRemoved()
Model.Implementation
willBeRemoved in class Model.Implementationpublic void tick(float elapsed)
Tickable
tick in interface Tickabletick in class Model.Implementation
public boolean getIntersection(Ray3D ray,
Vector3f result)
Intersectable
getIntersection in interface IntersectablegetIntersection in class Model.Implementationpublic void composite()
CompositableDependencys and Enqueueables to the compositor in
preparation for rendering.
composite in interface Compositablecomposite in class Model.Implementationprotected void updateFromConfig()
protected void animationStarted(Animation animation,
float overrideBlendOut)
overrideBlendOut - if non-negative, an interval over which to blend out all
animations currently playing at the same priority level as this one.
protected void animationStopped(Animation animation,
boolean completed)
protected Articulated.Node getAttachmentNode(String name)
null if no such node exists.
protected void detachAll(Articulated.Node node)
protected void updateTransforms()
protected boolean getSkinIntersection(Ray3D ray,
Vector3f result)
protected static SceneElement.TickPolicy mergePolicy(SceneElement.TickPolicy policy,
Model model)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||