libgdx API

com.badlogic.gdx.graphics.g3d.model.skeleton
Class Skeleton

java.lang.Object
  extended by com.badlogic.gdx.graphics.g3d.model.skeleton.Skeleton

public class Skeleton
extends java.lang.Object


Field Summary
 ObjectMap<java.lang.String,SkeletonAnimation> animations
          map of animations, indexed by name
 Array<SkeletonKeyframe> animPoseJoints
          the joints in breadth first order for the last calculates animation pose
 Array<SkeletonKeyframe> bindPoseJoints
          the bind pose joints in breadth first order
 Array<Matrix4> combinedMatrices
          combined scene and offset matrices
 Array<SkeletonJoint> hierarchy
          each joint is a root joint in the hierachy
 Array<java.lang.String> jointNames
          the names of each joint in breadth first order
 java.util.Map<java.lang.String,java.lang.Integer> namesToIndices
          names to indices
 Array<Matrix4> offsetMatrices
          the offset matrices for each joint in the same order as the bindPoseJoints
 Array<Matrix4> sceneMatrices
          the scene matrices for each joint in the same order as bindPoseJoints
 
Constructor Summary
Skeleton()
           
 
Method Summary
 void buildFromHierarchy()
          Fills the baseJoints, offsetMatrices and sceneMatrices Array instances with joints and Matrix4 instances in an breadth first order.
protected  void calculateMatrices(Array<SkeletonKeyframe> joints)
           
protected  void calculateOffsetMatrices()
           
 void setAnimation(java.lang.String name, float time)
           
 void setBindPose()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hierarchy

public final Array<SkeletonJoint> hierarchy
each joint is a root joint in the hierachy


jointNames

public final Array<java.lang.String> jointNames
the names of each joint in breadth first order


namesToIndices

public final java.util.Map<java.lang.String,java.lang.Integer> namesToIndices
names to indices


bindPoseJoints

public final Array<SkeletonKeyframe> bindPoseJoints
the bind pose joints in breadth first order


animPoseJoints

public final Array<SkeletonKeyframe> animPoseJoints
the joints in breadth first order for the last calculates animation pose


offsetMatrices

public final Array<Matrix4> offsetMatrices
the offset matrices for each joint in the same order as the bindPoseJoints


sceneMatrices

public final Array<Matrix4> sceneMatrices
the scene matrices for each joint in the same order as bindPoseJoints


combinedMatrices

public final Array<Matrix4> combinedMatrices
combined scene and offset matrices


animations

public final ObjectMap<java.lang.String,SkeletonAnimation> animations
map of animations, indexed by name

Constructor Detail

Skeleton

public Skeleton()
Method Detail

buildFromHierarchy

public void buildFromHierarchy()
Fills the baseJoints, offsetMatrices and sceneMatrices Array instances with joints and Matrix4 instances in an breadth first order. This allows one to iterate over the joint arrays instead of recursing over the hierarchy when calculating the scene matrices.


calculateOffsetMatrices

protected void calculateOffsetMatrices()

calculateMatrices

protected void calculateMatrices(Array<SkeletonKeyframe> joints)

setAnimation

public void setAnimation(java.lang.String name,
                         float time)

setBindPose

public void setBindPose()

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)