//converts from the human readable to the disk format public void Fill(JCTData jctData) { name = jctData.name; boneNames = jctData.boneNames; worldPositions = new Vector3Cereal[jctData.worldPositions.Length]; localPositions = new Vector3Cereal[jctData.localPositions.Length]; int i = 0; foreach (Vector3 v in jctData.worldPositions) { worldPositions[i].Fill(v, i); i++; } i = 0; foreach (Vector3 v in jctData.localPositions) { localPositions[i].Fill(v, i); i++; } }
//Converts from the disk format to the human readable format public JCTData Extract() { JCTData jctData = new JCTData(); jctData.name = name; jctData.boneNames = boneNames; jctData.worldPositions = new Vector3[worldPositions.Length]; jctData.localPositions = new Vector3[localPositions.Length]; int j = 0; foreach (Vector3Cereal v in worldPositions) { Vector3 vector = v.Get(ref j); jctData.worldPositions[j] = vector; } foreach (Vector3Cereal v in localPositions) { Vector3 vector = v.Get(ref j); jctData.localPositions[j] = vector; } return(jctData); }