artofillusion.animation
Class Skeleton

java.lang.Object
  extended by artofillusion.animation.Skeleton

public class Skeleton
extends java.lang.Object

This class represents the skeleton of an animated object.


Constructor Summary
Skeleton()
           
Skeleton(java.io.DataInputStream in)
          Reconstruct a skeleton from its serialized representation.
 
Method Summary
 void addAllJoints(Skeleton s)
          Add every joint from another skeleton to this one.
 void addJoint(Joint j, int parentID)
          Add a joint to the skeleton.
static void adjustMesh(Mesh oldMesh, Mesh newMesh)
          Update a mesh after its skeleton has moved.
 void blend(Skeleton average, Skeleton[] s, double[] weight)
          Modify a Skeleton to be a weighted average of an arbitrary list of Skeletons, averaged about this one.
 void copy(Skeleton s)
          Make this skeleton idenical to another one.
 void deleteJoint(int id)
          Delete a joint from the skeleton.
 void draw(MeshViewer view, boolean enabled)
          Draw the skeleton onto a canvas.
 Skeleton duplicate()
          Create an exact duplicate of this skeleton.
 boolean equals(java.lang.Object o)
          Determine if this skeleton is identical to another one.
 int findJointIndex(int id)
          Find the array index for a given joint ID.
 Joint getJoint(int id)
          Get the joint with the specified ID, or null if there is none.
 Joint[] getJoints()
          Get an array of all the joints.
 int getNextJointID()
          Get the ID for the next joint to be added.
 int getNumJoints()
          Get the number of joints in the skeleton.
 void scale(double x, double y, double z)
          Scale the skeleton by the specified amount along each axis.
 void setJointParent(Joint j, Joint parent)
          Set the parent of a joint.
 void writeToStream(java.io.DataOutputStream out)
          Write a serialized representation of this skeleton to a stream.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Skeleton

public Skeleton()

Skeleton

public Skeleton(java.io.DataInputStream in)
         throws java.io.IOException,
                java.io.InvalidObjectException
Reconstruct a skeleton from its serialized representation.

Throws:
java.io.IOException
java.io.InvalidObjectException
Method Detail

duplicate

public Skeleton duplicate()
Create an exact duplicate of this skeleton.


copy

public void copy(Skeleton s)
Make this skeleton idenical to another one.


equals

public boolean equals(java.lang.Object o)
Determine if this skeleton is identical to another one.

Overrides:
equals in class java.lang.Object

addJoint

public void addJoint(Joint j,
                     int parentID)
Add a joint to the skeleton.


deleteJoint

public void deleteJoint(int id)
Delete a joint from the skeleton. If it has children, all of them will be deleted as well.


addAllJoints

public void addAllJoints(Skeleton s)
Add every joint from another skeleton to this one.


setJointParent

public void setJointParent(Joint j,
                           Joint parent)
Set the parent of a joint.


findJointIndex

public int findJointIndex(int id)
Find the array index for a given joint ID.


getJoint

public Joint getJoint(int id)
Get the joint with the specified ID, or null if there is none.


getJoints

public Joint[] getJoints()
Get an array of all the joints.


getNumJoints

public int getNumJoints()
Get the number of joints in the skeleton.


getNextJointID

public int getNextJointID()
Get the ID for the next joint to be added.


scale

public void scale(double x,
                  double y,
                  double z)
Scale the skeleton by the specified amount along each axis.


blend

public void blend(Skeleton average,
                  Skeleton[] s,
                  double[] weight)
Modify a Skeleton to be a weighted average of an arbitrary list of Skeletons, averaged about this one.

Parameters:
average - the Skeleton to modify to be an average of other Skeletons
s - the list of Skeletons to average
weight - the weights for the different Skeletons

draw

public void draw(MeshViewer view,
                 boolean enabled)
Draw the skeleton onto a canvas.


adjustMesh

public static void adjustMesh(Mesh oldMesh,
                              Mesh newMesh)
Update a mesh after its skeleton has moved. oldMesh is the mesh before movement. newMesh is a duplicate of it with its skeleton in a different position. This method repositions the vertices of newMesh based on the skeleton.


writeToStream

public void writeToStream(java.io.DataOutputStream out)
                   throws java.io.IOException
Write a serialized representation of this skeleton to a stream.

Throws:
java.io.IOException


Copyright © 1999-2011 by Peter Eastman.