Normand Briere
2018-07-01 89c1ad67bc65d24ceadfa9e95f8c5515283f1e97
Mocap.java
....@@ -29,7 +29,7 @@
2929
3030 void Fade()
3131 {
32
- if (true) // currentbones == null || CameraPane.fullreset)
32
+ if (currentbones == null || CameraPane.fullreset)
3333 return;
3434
3535 cVector temp = new cVector();
....@@ -107,7 +107,7 @@
107107 //data[f3 + i] += pos[i] - data[frame3 + i];
108108 // data[f3 + i] = k*data[f3+i] + (1-k)*
109109 // currentbones[boneframe3 + i-end];
110
- data[f3 + i] = (float)CurveAngle(data[f3+i], currenthip[i], 1-k);
110
+// data[f3 + i] = (float)CurveAngle(data[f3+i], currenthip[i], 1-k);
111111 }
112112
113113 // TODO: translation
....@@ -225,7 +225,7 @@
225225 // before resetting the mocap data.
226226 void SetGlobalTransform()
227227 {
228
- SetCurrentBones(frame);
228
+ //SetCurrentBones(frame);
229229
230230 cVector temp = new cVector();
231231 cVector pos = new cVector();
....@@ -235,6 +235,12 @@
235235 double angleYhip = 0;
236236
237237 Object3D hip = get(0);
238
+
239
+ if (hip.get(0).toParent == null)
240
+ {
241
+ hip.get(0).toParent = LA.newMatrix();
242
+ hip.get(0).fromParent = LA.newMatrix();
243
+ }
238244
239245 LA.matConcat(toParent, hip.get(0).toParent, matrix);
240246 poship.x = matrix[3][0];
....@@ -3020,7 +3026,8 @@
30203026 }
30213027 }
30223028
3023
- static int offset = 1; // 5; // 10; // 5; // 100; // skip initial "T"
3029
+ // skip initial "T"
3030
+ static int offset = 1; // 5; // 10; // 5; // 100;
30243031
30253032 void ReadBVH()
30263033 {
....@@ -3132,7 +3139,7 @@
31323139 baseframe += step;
31333140
31343141 //frame = baseframe;
3135
- frame += step;
3142
+ //frame += step;
31363143
31373144 // if (frame != baseframe)
31383145 // {
....@@ -3184,13 +3191,17 @@
31843191 }
31853192 }
31863193 }
3194
+
3195
+ frame = GetFirstFrame();
31873196 }
3197
+ else
3198
+ frame += step;
31883199
31893200 //SetPositionDelta(false);
31903201
3191
- if (frame >= bvh.animation.getNumFrames())
3192
- //baseframe =
3193
- frame = GetFirstFrame(); // 0; // offset; // initial point
3202
+// if (frame >= bvh.animation.getNumFrames())
3203
+// //baseframe =
3204
+// frame = GetFirstFrame(); // 0; // offset; // initial point
31943205
31953206 //System.err.println("frame = " + frame);
31963207 if (lastframe != 0)