A Node
that provides mappings between the bones of a skinned ModelRenderable
and
a set of Node
s.
When an animation is playing, the transform of the attached Node
s will be set during
onUpdate(FrameTime)
.
Manipulating attached Node
s will also transform corresponding bones. Child bones will
not automatically be transformed. To change the transformations of child bones, the child bones
will need to be attached to child nodes. If an animation is playing, the node and bone will be
set to the animation state each frame during onUpdate(FrameTime)
. However,
attached Node
s can be manipulated after onUpdate(FrameTime)
each
frame to manipulate bones while an animation is playing.
When the attached Node
's isActive()
is false, they are not transformed
and don't transform bones.
The attached Node
s are also not transformed if they are bound to a boneName that
doesn't match any bones in the ModelRenderable
.
Calling setRenderable(Renderable)
will not change the Node
mappings. The
attached Node
s' transforms will immediately be set to the pose of matching bones in the
new ModelRenderable
.
Public Constructors
Public Methods
Node | |
void | |
void | |
void |
Inherited Methods
Public Constructors
public SkeletonNode ()
Public Methods
public void onUpdate (FrameTime frameTime)
Handles when this node is updated. A node is updated before rendering each frame. This is only called when the node is active.
Override to perform any updates that need to occur each frame.
Parameters
frameTime | provides time information for the current frame |
---|
public void setBoneAttachment (String boneName, Node node)
Attaches a Node
to the specified boneName. This will immediately set the transform of
the Node
to the pose of the bone named boneName in getRenderable()
if it
exists.
If the Node
is null, then any previously attached Node
will be detached.
Only one Node
may be attached to a boneName at a time.
Parameters
boneName | |
---|---|
node |
public void setRenderable (Renderable renderable)
Sets the Renderable
to display for this node. If setCollisionShape(CollisionShape)
is not set, then getCollisionShape()
is used to detect collisions for this Node
.
Parameters
renderable | Usually a 3D model. If null, this node's current renderable will be removed. |
---|