Potentially fix weird hip issues (#1244)

This commit is contained in:
Collin authored and GitHub committed 2024-11-21 21:46:53 +02:00
1 parent 6232903691
commit 8fe2540f91
1 file changed
+4 -5
@@ -877,11 +877,10 @@ class HumanSkeleton(
val extendedPelvisRot = extendedPelvisYawRoll(leftLegRot, rightLegRot, hipRot)
// Interpolate between the hipRot and extendedPelvisRot
val newHipRot = if (extendedPelvisRot.lenSq() != 0.0f) {
hipRot.interpR(extendedPelvisRot, hipLegsAveraging)
} else {
Quaternion.IDENTITY
}
val newHipRot = hipRot.interpR(
if (extendedPelvisRot.lenSq() != 0.0f) extendedPelvisRot else IDENTITY,
hipLegsAveraging,
)
// Set new hip rotation
hipBone.setRotation(newHipRot)