Well, I don’t have it posted anywhere at the moment. I can post the part of the method where the loading is occurring here though. If you need any more than this, I’ll have to e-mail it to you or something. This code chunk occurs with in the data loader at the end.
'
float animFPS = Conversion.byte2float(byteBuffer, dataPointer);
dataPointer += 8;
int totalFrames = Conversion.byte2int(byteBuffer, dataPointer);
dataPointer +=4;
totalTime = totalFrames * 1000.0f/animFPS;
numJoints = Conversion.byte2short(byteBuffer, dataPointer);
dataPointer += 2;
joints = new Joint[numJoints];
int tempPointer = dataPointer;
JointNameListRec[] nameList = new JointNameListRec[numJoints];
for(int i = 0; i < numJoints; i++) {
MS3DJoint joint = new MS3DJoint(byteBuffer, tempPointer);
tempPointer += joint.sizeof();
tempPointer += 16 * (joint.numRotationKeyframes +
joint.numTranslationKeyframes);
nameList[i] = new JointNameListRec();
nameList[i].jointIndex = i;
nameList[i].name = Conversion.byte2String(joint.name);
}
for(int i = 0; i < numJoints; i++) {
MS3DJoint joint = new MS3DJoint(byteBuffer, dataPointer);
dataPointer += joint.sizeof();
int j, parentIndex = -1;
if(joint.parentName.length > 0) {
for(j = 0; j < numJoints; j++) {
if(nameList[j].name.equalsIgnoreCase(new String(joint.parentName))) {
parentIndex = nameList[j].jointIndex;
break;
}
}
if(parentIndex == -1) {
//no parent joint.
}
}
joints[i] = new Joint();
joints[i].localRotation = joint.rotation;
joints[i].localTranslation = joint.translation;
joints[i].parent = parentIndex;
joints[i].numRotationKeyframes = joint.numRotationKeyframes;
joints[i].numTranslationKeyframes = joint.numTranslationKeyframes;
joints[i].translationKeyframes = new Keyframe[joint.numTranslationKeyframes];
for(j = 0; j < joint.numRotationKeyframes; j++) {
MS3DKeyframe keyframe = new MS3DKeyframe(byteBuffer, dataPointer);
dataPointer += keyframe.sizeof();
setJointKeyframe(i,j,keyframe.time*1000.0f,keyframe.parameter,true);
}
for(j = 0; j < joint.numRotationKeyframes; j++) {
MS3DKeyframe keyframe = new MS3DKeyframe(byteBuffer, dataPointer);
dataPointer += keyframe.sizeof();
setJointKeyframe(i,j,keyframe.time*1000.0f,keyframe.parameter,false);
}
}
setupJoints();
}
All values, totalFrames, numJoints etc are very high, ie 30,000.
Let me know if there is any thing else you’d like to see.