Fix tracking pause neck

This commit is contained in:
Erimel committed 2026-10-26 15:45:36 -04:00
1 parent 4b44cd1414
commit 8a7794545c
2 files changed
+8 -14

No files matched your search

+5 -5
View File
@@ -235,11 +235,11 @@ body {
--background-80: 7, 20, 7;
--background-90: 2, 6, 2;
--accent-background-10: 222, 214, 104;
--accent-background-20: 199, 190, 60;
--accent-background-30: 148, 141, 44;
--accent-background-10: 222, 212, 104;
--accent-background-20: 199, 187, 60;
--accent-background-30: 140, 132, 42;
--accent-background-40: 133, 125, 40;
--accent-background-50: 64, 61, 19;
--accent-background-50: 64, 60, 19;
--success: 80, 232, 151;
--warning: 255, 225, 53;
@@ -346,7 +346,7 @@ body {
--accent-background-50: 59, 25, 6;
--success: 100, 230, 10;
--warning: 240, 190, 50;
--warning: 240, 199, 50;
--critical: 220, 40, 110;
--special: 227, 89, 34;
--window-icon-stroke: 205, 81, 0;
@@ -187,7 +187,9 @@ class ComputedSkeletonBehaviour(
val ikComputedProcessors: List<SkeletonComputedProcessor> = emptyList(),
val waiter: PreciseWaiter,
) : SkeletonBehaviour {
// BodyParts that are active even when tracking is paused
private val ALWAYS_ACTIVE_PARTS = arrayOf(BodyPart.HEAD, BodyPart.NECK)
private val IK_THRESHOLD = 0.002f
private val IK_MAX_ITERATIONS = 100
@@ -257,15 +259,7 @@ class ComputedSkeletonBehaviour(
}
// Use single map for the inputs that we'll mutate for performance
val mutableBoneInputs: InputSkeleton = BodyPartMap(
if (targetState.pausedProcessedBoneInputs != null) {
// If tracking is paused, we only run the skeleton loop for the always active bones (head and neck)
// and add the pausedProcessedBoneInputs later on.
targetState.boneInputs.filter { it.key in ALWAYS_ACTIVE_PARTS }
} else {
targetState.boneInputs
},
)
val mutableBoneInputs: InputSkeleton = BodyPartMap(targetState.boneInputs)
// Run pre-FK processors (input processors)
for (processor in inputProcessors) processor.process(mutableBoneInputs, targetState.skeletonHeight)