diff --git a/server/core/src/main/java/dev/slimevr/skeleton/behaviours.kt b/server/core/src/main/java/dev/slimevr/skeleton/behaviours.kt index 270f5a077..0d31d8dbb 100644 --- a/server/core/src/main/java/dev/slimevr/skeleton/behaviours.kt +++ b/server/core/src/main/java/dev/slimevr/skeleton/behaviours.kt @@ -222,6 +222,7 @@ class ComputedSkeletonBehaviour( val boneInputs = if (targetState.pausedProcessedBoneInputs != null) { // TODO improve pause tracking code + // and also possibly head default position (HeadPositionFallbackProcessor) // Use already-processed paused tracking data except for the head val headBone = targetState.boneInputs[BodyPart.HEAD] targetState.pausedProcessedBoneInputs.mutateCopy { it[BodyPart.HEAD] = headBone?.copy(position = if (headBone.isPositionActive) headBone.position else it[BodyPart.HEAD]?.position) } diff --git a/server/core/src/main/java/dev/slimevr/skeleton/inputprocessors/bone-prediction.kt b/server/core/src/main/java/dev/slimevr/skeleton/inputprocessors/bone-prediction.kt index 42294aab6..947e43cf8 100644 --- a/server/core/src/main/java/dev/slimevr/skeleton/inputprocessors/bone-prediction.kt +++ b/server/core/src/main/java/dev/slimevr/skeleton/inputprocessors/bone-prediction.kt @@ -53,6 +53,8 @@ class BonePredictionInputProcessor(val settings: Settings) : SkeletonInputProces val newVelocities = bodyPartMap() mutableInputSkeleton.forEachBone { bodyPart, bone -> + if (!bone.isRotationActive) return@forEachBone + val prev = velocities[bodyPart] if (prev == null) { newVelocities[bodyPart] = BoneVelocity(bone.rotation, Quaternion.IDENTITY, now) diff --git a/server/core/src/main/java/dev/slimevr/skeleton/inputprocessors/bone-smoothing.kt b/server/core/src/main/java/dev/slimevr/skeleton/inputprocessors/bone-smoothing.kt index 6eed05556..3b0d5b873 100644 --- a/server/core/src/main/java/dev/slimevr/skeleton/inputprocessors/bone-smoothing.kt +++ b/server/core/src/main/java/dev/slimevr/skeleton/inputprocessors/bone-smoothing.kt @@ -41,6 +41,8 @@ class BoneSmoothingInputProcessor(val settings: Settings) : SkeletonInputProcess val newSmoothed = bodyPartMap() mutableInputSkeleton.forEachBone { bodyPart, bone -> + if (!bone.isRotationActive) return@forEachBone + val prev = smoothed[bodyPart] ?: bone.rotation val rotation = prev.lerpR(bone.rotation, alpha).unit() newSmoothed[bodyPart] = rotation diff --git a/server/core/src/main/java/dev/slimevr/skeleton/module.kt b/server/core/src/main/java/dev/slimevr/skeleton/module.kt index 65d5099d3..fab22eee8 100644 --- a/server/core/src/main/java/dev/slimevr/skeleton/module.kt +++ b/server/core/src/main/java/dev/slimevr/skeleton/module.kt @@ -190,6 +190,8 @@ class Skeleton( ComputedSkeletonBehaviour( hz = hz, inputProcessors = listOf( + BonePredictionInputProcessor(settings), + BoneSmoothingInputProcessor(settings), HeadPositionFallbackProcessor(settings), BoneYawFallbackInputProcessor(), BoneActiveLinkInputProcessor(), @@ -198,8 +200,6 @@ class Skeleton( UpperLegsRollAlignInputProcessor(settings), BoneDirectLinkInputProcessor(), FingerImputeInputProcessor(), - BonePredictionInputProcessor(settings), - BoneSmoothingInputProcessor(settings), ), fkProcessors = listOf( VelocityFkProcessor(),