From bacf9b09c7d122d601eff0fb5ca4b32b2b7b135e Mon Sep 17 00:00:00 2001 From: Erimel Date: Tue, 6 Oct 2026 17:15:37 -0400 Subject: [PATCH] Fix floorclip --- .../java/dev/slimevr/skeleton/targetprocessors/floor-clip.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/core/src/main/java/dev/slimevr/skeleton/targetprocessors/floor-clip.kt b/server/core/src/main/java/dev/slimevr/skeleton/targetprocessors/floor-clip.kt index 0d19a583f..1cdbe5896 100644 --- a/server/core/src/main/java/dev/slimevr/skeleton/targetprocessors/floor-clip.kt +++ b/server/core/src/main/java/dev/slimevr/skeleton/targetprocessors/floor-clip.kt @@ -25,13 +25,13 @@ class FloorClipTargetProcessor( val parentTargetY = mutableIkTargets[parentPart] ?: fk[parentPart]?.tailPosition ?: continue // Offset the parent target by the lowest child as well so that none of its active children are under the floor either. - var lowestChildTargetY = parentTargetY.y + var lowestChildTargetY = 0f for ((_, childPart) in iterateBodyPartHierarchy(parentPart, true)) { if (inputSkeleton[childPart]?.isRotationActive == false) continue val target = mutableIkTargets[childPart] ?: fk[childPart]?.tailPosition ?: continue if (target.y < lowestChildTargetY) lowestChildTargetY = target.y } - val childOffset = (parentTargetY.y - lowestChildTargetY).coerceAtLeast(0f) + val childOffset = if (lowestChildTargetY < 0f) (parentTargetY.y - lowestChildTargetY).coerceAtLeast(0f) else 0f // Snap the parent up. val targetY = parentTargetY.y.coerceAtLeast(floorLevel) + childOffset