Normand Briere
2019-11-21 ddb10cb84dddfeef1ef9946f2e13cef3c93e6cc4
RagDoll.java
....@@ -321,8 +321,8 @@
321321 transform.setIdentity();
322322 if ((body = bodies[BodyPart.BODYPART_LEFT_LOWER_ARM.ordinal()]) == null)
323323 body = bodies[BodyPart.BODYPART_LEFT_LOWER_ARM.ordinal()] = localCreateRigidBody(1f, 0, transform, shapes[BodyPart.BODYPART_LEFT_LOWER_ARM.ordinal()]);
324
- transform.origin.set(-(lowerarmlength/2 + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth + zoffset);
325
- MatrixUtil.setEulerZYX(transform.basis, 0, 0, BulletGlobals.SIMD_HALF_PI);
324
+ transform.origin.set(-(lowerarmlength/2 + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth + zoffset + scale_ragdoll * lowerarmlength / 2 * 0.5f);
325
+ MatrixUtil.setEulerZYX(transform.basis, BulletGlobals.SIMD_HALF_PI/4, 0, BulletGlobals.SIMD_HALF_PI);
326326 tmpTrans.mul(offset, transform);
327327 body.worldTransform.set(tmpTrans);
328328 body.getMotionState().setWorldTransform(tmpTrans);
....@@ -351,8 +351,8 @@
351351 transform.setIdentity();
352352 if ((body = bodies[BodyPart.BODYPART_RIGHT_LOWER_ARM.ordinal()]) == null)
353353 body = bodies[BodyPart.BODYPART_RIGHT_LOWER_ARM.ordinal()] = localCreateRigidBody(1f, 0, transform, shapes[BodyPart.BODYPART_RIGHT_LOWER_ARM.ordinal()]);
354
- transform.origin.set((lowerarmlength/2 + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth + zoffset);
355
- MatrixUtil.setEulerZYX(transform.basis, 0, 0, -BulletGlobals.SIMD_HALF_PI);
354
+ transform.origin.set((lowerarmlength/2 + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth + zoffset + scale_ragdoll * lowerarmlength / 2 * 0.5f);
355
+ MatrixUtil.setEulerZYX(transform.basis, BulletGlobals.SIMD_HALF_PI/4, 0, -BulletGlobals.SIMD_HALF_PI);
356356 tmpTrans.mul(offset, transform);
357357 body.worldTransform.set(tmpTrans);
358358 body.getMotionState().setWorldTransform(tmpTrans);