File tree 1 file changed +6
-13
lines changed
1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -1460,24 +1460,17 @@ void GenericCAO::updateBonePosition()
1460
1460
if (!bone)
1461
1461
continue ;
1462
1462
1463
- // If bone is manually positioned there is no need to perform the bug check
1464
- bool skip = false ;
1465
- for (auto &it : m_bone_position) {
1466
- if (it.first == bone->getName ()) {
1467
- skip = true ;
1468
- break ;
1469
- }
1470
- }
1471
- if (skip)
1472
- continue ;
1473
-
1474
1463
// Workaround for Irrlicht bug
1475
1464
// We check each bone to see if it has been rotated ~180deg from its expected position due to a bug in Irricht
1476
1465
// when using EJUOR_CONTROL joint control. If the bug is detected we update the bone to the proper position
1477
1466
// and update the bones transformation.
1478
1467
v3f bone_rot = bone->getRelativeTransformation ().getRotationDegrees ();
1479
- float offset = fabsf (bone_rot.X - bone->getRotation ().X );
1480
- if (offset > 179 .9f && offset < 180 .1f ) {
1468
+ float offset_X = fabsf (bone_rot.X - bone->getRotation ().X );
1469
+ float offset_Y = fabsf (bone_rot.Y - bone->getRotation ().Y );
1470
+ float offset_Z = fabsf (bone_rot.Z - bone->getRotation ().Z );
1471
+ if ((offset_X > 179 .9f && offset_X < 180 .1f )
1472
+ || (offset_Y > 179 .9f && offset_Y < 180 .1f )
1473
+ || (offset_Z > 179 .9f && offset_Z < 180 .1f )) {
1481
1474
bone->setRotation (bone_rot);
1482
1475
bone->updateAbsolutePosition ();
1483
1476
}
You can’t perform that action at this time.
0 commit comments