Beispiel #1
0
 public static void setBonesSuchAs(AnimControl animControl, String animationName) {
   Animation animation = animControl.getAnim(animationName);
   int size = animControl.getSkeleton().getBoneCount();
   for (int index = 0; index < size; index++) {
     Bone bone = animControl.getSkeleton().getBone(index);
     BoneTrack boneTrack = getFirstTrackForBone(animation, index);
     if (boneTrack != null) {
       Quaternion rotation = boneTrack.getRotations()[0];
       Vector3f translation = boneTrack.getTranslations()[0];
       Vector3f scale = boneTrack.getScales()[0];
       System.out.println("Bone = " + bone.getName());
       System.out.println("\tRotation = " + rotation);
       System.out.println("\tTranslation = " + translation);
       System.out.println("\tScale = " + scale);
       bone.setUserControl(true);
       bone.setUserTransforms(translation, rotation, scale);
       bone.updateWorldVectors();
       bone.setUserControl(false);
     }
   }
 }