mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-06 08:42:32 -08:00
Disable arm IK if arm trackers are active
This commit is contained in:
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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user