Disable arm IK if arm trackers are active

This commit is contained in:
Butterscotch! committed 2026-09-21 21:48:34 -04:00
1 parent 6b607ad453
commit b662b03556
1 file changed
+11
@@ -16,8 +16,19 @@ class PositionalTargetProcessor(
BodyPart.RIGHT_HAND to BodyPart.RIGHT_LOWER_ARM,
),
) : SkeletonTargetProcessor {
val requiredInactive = arrayOf(
BodyPart.LEFT_LOWER_ARM,
BodyPart.LEFT_UPPER_ARM,
BodyPart.RIGHT_LOWER_ARM,
BodyPart.RIGHT_UPPER_ARM,
)
override fun process(mutableIkTargets: IKTargets, inputSkeleton: InputSkeleton, fk: ComputedSkeleton, floorLevel: Float) {
if (!settings.context.state.value.data.skeletonConfig.toggles.useTrackerPositions) return
// TODO Use active rotations as IK constraints instead and fill in the blanks
// Disable if you have arm trackers
if (requiredInactive.any { inputSkeleton[it]?.isRotationActive == true }) return
for ((bodyPart, target) in bodyParts) {
mutableIkTargets[target] = inputSkeleton[bodyPart]?.position ?: continue
}