public final class Skeleton
extends java.lang.Object
implements java.lang.Cloneable
| Constructor and Description |
|---|
Skeleton(JointMotion bindPose) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMotion(JointMotion motion)
Add a
JointMotion to this Skeleton. |
void |
applySort(Model model,
java.util.HashMap<java.lang.Integer,java.lang.Integer> sort) |
Skeleton |
duplicate() |
void |
filter(Model model,
boolean[] keep)
Internal use by
Optimizer |
JointMotion |
getBindPose() |
void |
getBindPoseMatrixInv(int index,
Mat4x4 dst) |
JointMotion |
getMotion(Animation animation) |
JointMotion |
getMotion(int index) |
JointMotion |
getMotion(java.lang.String motionName) |
int |
getNumMotions() |
int |
jointNameToID(java.lang.String jointName) |
void |
makeBindPoseMatrices()
Compute
JointKey.transformBindPose for all skeleton keys |
Motion |
merge(Model model,
Motion motion)
Add a compatible skeletal animation to the model
|
void |
reconnectJoints(int oldIndex,
int newIndex)
Reconnect hierarchy replacing link to oldIndex by newIndex
|
boolean |
removeMotion(JointMotion motion)
Remove a
JointMotion from this Skeleton. |
void |
renameJoint(int jointID,
java.lang.String newName) |
void |
renameMotion(Model model,
JointMotion motion,
java.lang.String newName)
Safely rename a
JointMotion, ie update all references |
void |
replaceJointInfluence(Model model,
java.lang.String oldJointName,
java.lang.String newJointName) |
Motion |
retarget(Model model,
Motion motion,
JointMotion animBindPose,
java.util.Map<java.lang.String,java.lang.String> modelToMotionName,
java.util.Set<java.lang.String> keepInitialBindPose,
boolean ignoreFirstFrame,
boolean reorientLastJoint,
boolean optimize,
java.lang.String name)
Re-target an animation to the skeleton
|
java.util.HashMap<java.lang.Integer,java.lang.Integer> |
sort()
Sort joint to the format expected by the engine.
|
void |
transform(Mat4x4 matrix)
Deprecated.
|
public Skeleton(JointMotion bindPose)
public final Skeleton duplicate()
public final JointMotion getBindPose()
JointMotion: it defines the Joint hierarchy, naming and initial pose of this Skeletonpublic final int getNumMotions()
JointMotion, not including the bind posepublic final JointMotion getMotion(Animation animation)
JointMotion used by the specified Animation, or bind posepublic final JointMotion getMotion(int index)
JointMotion to getpublic final JointMotion getMotion(java.lang.String motionName)
JointMotion , or null if not foundpublic final void addMotion(JointMotion motion)
JointMotion to this Skeleton.Animation object that uses the JointMotion,
for that use Model.addAnimation(Animation, JointMotion) instead.motion - JointMotion to addModel.addAnimation(Animation, JointMotion)public final boolean removeMotion(JointMotion motion)
JointMotion from this Skeleton.Animation that uses the specified JointMotionmotion - JointMotion to removepublic final void makeBindPoseMatrices()
JointKey.transformBindPose for all skeleton keyspublic final void getBindPoseMatrixInv(int index,
Mat4x4 dst)
@Deprecated public final void transform(Mat4x4 matrix)
public final java.util.HashMap<java.lang.Integer,java.lang.Integer> sort()
applySort(Model, HashMap)public final void applySort(Model model, java.util.HashMap<java.lang.Integer,java.lang.Integer> sort)
public final void replaceJointInfluence(Model model, java.lang.String oldJointName, java.lang.String newJointName)
model - Model to apply sortingpublic final int jointNameToID(java.lang.String jointName)
public final Motion retarget(Model model, Motion motion, JointMotion animBindPose, java.util.Map<java.lang.String,java.lang.String> modelToMotionName, java.util.Set<java.lang.String> keepInitialBindPose, boolean ignoreFirstFrame, boolean reorientLastJoint, boolean optimize, java.lang.String name)
model - Modelmotion - animation to re-targetanimBindPose - bind pose of the animation to be re-targetedmodelToMotionName - Joint name mapping between model joint (key) and motion joint (value)keepInitialBindPose - Joint list of model joint name. The retarget algorithm use this for better anatomic binding between model and motion.reorientLastJoint - reorient last joint, using true may sometimes result to artifact with the current algorithmoptimize - optimize memory usage. Recommended in general cases (except when the model is fully optimized), but consume noticeable amount of timename - name of the retargetted motion, optional: null to use name from motion parameterMotion retargettedpublic final Motion merge(Model model, Motion motion)
public final void renameJoint(int jointID,
java.lang.String newName)
jointID - index of the joint to renamenewName - new namepublic final void reconnectJoints(int oldIndex,
int newIndex)
oldIndex - old parent indexnewIndex - new parent indexpublic final void renameMotion(Model model, JointMotion motion, java.lang.String newName)
JointMotion, ie update all referencesmotion - newName - Bonzai Engine 1.3.4 11/12/2015 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2015 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com