Fix mocap mode breaking on startup (#1046)

This commit is contained in:
Collin authored and GitHub committed 2024-06-07 01:25:57 +03:00
1 parent 721a74aacc
commit e64edb76dd
1 file changed
+5 -1
@@ -622,7 +622,11 @@ class HumanSkeleton(
val extendedPelvisRot = extendedPelvisYawRoll(leftLegRot, rightLegRot, hipRot)
// Interpolate between the hipRot and extendedPelvisRot
val newHipRot = hipRot.interpR(extendedPelvisRot, hipLegsAveraging)
val newHipRot = if (extendedPelvisRot.lenSq() != 0.0f) {
hipRot.interpR(extendedPelvisRot, hipLegsAveraging)
} else {
Quaternion.IDENTITY
}
// Set new hip rotation
hipBone.setRotation(newHipRot)