use of org.rajawali3d.animation.mesh.SkeletalAnimationFrame.Skeleton in project Rajawali by Rajawali.
the class LoaderMD5Anim method parseFrame.
private void parseFrame(SkeletalAnimationFrame[] frames, int frameIndex, BufferedReader buffer) {
try {
String line;
SkeletalAnimationFrame frame = frames[frameIndex];
frame.setFrameIndex(frameIndex);
Skeleton skeleton = frame.getSkeleton();
SkeletonJoint[] joints = new SkeletonJoint[mNumJoints];
float[] frameData = new float[mNumAnimatedComponents];
int index = 0;
while ((line = buffer.readLine()) != null) {
line = line.replace("\t", " ");
StringTokenizer parts = new StringTokenizer(line, " ");
if (line.indexOf('}') > -1) {
skeleton.setJoints(joints);
buildFrameSkeleton(frameData, skeleton);
return;
}
while (parts.hasMoreTokens()) {
frameData[index++] = Float.parseFloat(parts.nextToken());
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations