Fix mocap mode breaking on startup (#1046)

This commit is contained in:
Collin
2024-06-06 15:25:57 -07:00
committed by GitHub
parent 721a74aacc
commit e64edb76dd

View File

@@ -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)