- vertices = 0;
- verticeslow = 0;
- verticesclothes = 0;
-
- numvertices = 0;
- numverticeslow = 0;
- numverticesclothes = 0;
- length = 0;
- targetlength = 0;
- parent1 = 0;
- parent2 = 0;
- maxlength = 0;
- minlength = 0;
- type = boneconnect;
- visible = 0;
- rotate1 = 0, rotate2 = 0, rotate3 = 0;
- lastrotate1 = 0, lastrotate2 = 0, lastrotate3 = 0;
- oldrotate1 = 0, oldrotate2 = 0, oldrotate3 = 0;
- newrotate1 = 0, newrotate2 = 0, newrotate3 = 0;
-
- strength = 0;
+ int numvertices, vertice, parentID;
+
+ // read info
+ funpackf(tfile, "Bf Bf Bf Bf Bf Bi Bi", &length, &targetlength, &minlength, &maxlength, &strength, &type, &numvertices);
+
+ // read vertices
+ for (int j = 0; j < numvertices; j++) {
+ funpackf(tfile, "Bi", &vertice);
+ if (vertice < vertexNum) {
+ vertices.push_back(vertice);
+ }
+ }
+
+ // read more info
+ funpackf(tfile, "Bb Bi", &visible, &parentID);
+ parent1 = &joints[parentID];
+ funpackf(tfile, "Bi", &parentID);
+ parent2 = &joints[parentID];