.. | .. |
---|
29 | 29 | |
---|
30 | 30 | void Fade() |
---|
31 | 31 | { |
---|
32 | | - if (true) // currentbones == null || CameraPane.fullreset) |
---|
| 32 | + if (currentbones == null || CameraPane.fullreset) |
---|
33 | 33 | return; |
---|
34 | 34 | |
---|
35 | 35 | cVector temp = new cVector(); |
---|
.. | .. |
---|
107 | 107 | //data[f3 + i] += pos[i] - data[frame3 + i]; |
---|
108 | 108 | // data[f3 + i] = k*data[f3+i] + (1-k)* |
---|
109 | 109 | // 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); |
---|
111 | 111 | } |
---|
112 | 112 | |
---|
113 | 113 | // TODO: translation |
---|
.. | .. |
---|
225 | 225 | // before resetting the mocap data. |
---|
226 | 226 | void SetGlobalTransform() |
---|
227 | 227 | { |
---|
228 | | - SetCurrentBones(frame); |
---|
| 228 | + //SetCurrentBones(frame); |
---|
229 | 229 | |
---|
230 | 230 | cVector temp = new cVector(); |
---|
231 | 231 | cVector pos = new cVector(); |
---|
.. | .. |
---|
235 | 235 | double angleYhip = 0; |
---|
236 | 236 | |
---|
237 | 237 | 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 | + } |
---|
238 | 244 | |
---|
239 | 245 | LA.matConcat(toParent, hip.get(0).toParent, matrix); |
---|
240 | 246 | poship.x = matrix[3][0]; |
---|
.. | .. |
---|
3020 | 3026 | } |
---|
3021 | 3027 | } |
---|
3022 | 3028 | |
---|
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; |
---|
3024 | 3031 | |
---|
3025 | 3032 | void ReadBVH() |
---|
3026 | 3033 | { |
---|
.. | .. |
---|
3132 | 3139 | baseframe += step; |
---|
3133 | 3140 | |
---|
3134 | 3141 | //frame = baseframe; |
---|
3135 | | - frame += step; |
---|
| 3142 | + //frame += step; |
---|
3136 | 3143 | |
---|
3137 | 3144 | // if (frame != baseframe) |
---|
3138 | 3145 | // { |
---|
.. | .. |
---|
3184 | 3191 | } |
---|
3185 | 3192 | } |
---|
3186 | 3193 | } |
---|
| 3194 | + |
---|
| 3195 | + frame = GetFirstFrame(); |
---|
3187 | 3196 | } |
---|
| 3197 | + else |
---|
| 3198 | + frame += step; |
---|
3188 | 3199 | |
---|
3189 | 3200 | //SetPositionDelta(false); |
---|
3190 | 3201 | |
---|
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 |
---|
3194 | 3205 | |
---|
3195 | 3206 | //System.err.println("frame = " + frame); |
---|
3196 | 3207 | if (lastframe != 0) |
---|