/** * Converts the action into JME bone animation tracks. * * @param skeleton * the skeleton that will be animated * @return the bone tracks for the node */ public BoneTrack[] toTracks(Skeleton skeleton, BlenderContext blenderContext) { List<BoneTrack> tracks = new ArrayList<BoneTrack>(featuresTracks.size()); for (Entry<String, Ipo> entry : featuresTracks.entrySet()) { int boneIndex = skeleton.getBoneIndex(entry.getKey()); BoneContext boneContext = blenderContext.getBoneContext(skeleton.getBone(boneIndex)); tracks.add((BoneTrack) entry.getValue().calculateTrack(boneIndex, boneContext, boneContext.getBone().getBindPosition(), boneContext.getBone().getBindRotation(), boneContext.getBone().getBindScale(), 1, stopFrame, fps, false)); } return tracks.toArray(new BoneTrack[tracks.size()]); }
private static Joint fromBone(Bone b) { Joint j = new Joint(b.getName()); j.setLocalTranslation(b.getBindPosition()); j.setLocalRotation(b.getBindRotation()); j.setLocalScale(b.getBindScale()); return j; }
for (int i = 0; i < skeleton.getBoneCount(); ++i) { Bone bone = skeleton.getBone(i); boneStartTransforms.put(bone, new Transform(bone.getBindPosition(), bone.getBindRotation(), bone.getBindScale()));
Vector3f oldScale = boneTrack.getScales()[i]; Vector3f newScale = new Vector3f(); newScale.set(bone.getBindScale()).multLocal(oldScale); scales[i] = newScale;
System.err.println("Bind translation: " + selectedBone.getBindPosition()); System.err.println("Bind rotation: " + selectedBone.getBindRotation()); System.err.println("Bind scale: " + selectedBone.getBindScale()); System.err.println("---"); System.err.println("Local translation: " + selectedBone.getLocalPosition());
public static boolean equalBindAndLocalTransforms(Bone b) { return equalsEpsilon(b.getBindPosition(), b.getLocalPosition()) && equalsEpsilon(b.getBindRotation(), b.getLocalRotation()) && equalsEpsilon(b.getBindScale(), b.getLocalScale()); }
Vector3f s = bone.getLocalScale().divide(bone.getBindScale());
Transform bindTransforms = new Transform(bone.getBindPosition(), bone.getBindRotation(), bone.getBindScale()); SkinData skinData = fetchFromCache("skins", skinIndex, SkinData.class);