From dd1225d774cea28cc75c37b933875b064614eae4 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 4 May 2026 07:03:12 +0000 Subject: [PATCH] Remove redundant isCharacterMesh detection in moveForward cap.localCenter is always the correct offset from mesh origin to capsule centre. For meshes whose origin sits at the bbox centre (characters, primitives) localCenter is zero, so the result is identical to the old Zero() branch. The name-based character guard was protecting against a case that never occurs. https://claude.ai/code/session_01HKKt5Tdz6MkqcyV8rLPRP2 --- api/movement.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/api/movement.js b/api/movement.js index 37a44e42..1db7e7e2 100644 --- a/api/movement.js +++ b/api/movement.js @@ -60,19 +60,7 @@ export const flockMovement = { const up = flock.BABYLON.Vector3.Up(); const scene = flock.scene; - const isCharacterMesh = - model.metadata?.isCharacter === true || - model.metadata?.kind === "character" || - model.metadata?.type === "character" || - (model.name || "").toLowerCase().includes("character") || - (model.metadata?.modelName || "").toLowerCase().includes("character") || - (model.name || "").toLowerCase().includes("liz") || - (model.metadata?.modelName || "").toLowerCase().includes("liz"); - - const capsuleLocalCenter = - !isCharacterMesh && cap.localCenter - ? cap.localCenter - : flock.BABYLON.Vector3.Zero(); + const capsuleLocalCenter = cap.localCenter || flock.BABYLON.Vector3.Zero(); // Desired horizontal direction from camera const cameraForward = scene.activeCamera.getForwardRay().direction;