From 4eb0584f6d45bd23a15c1b67387474392c1569ad Mon Sep 17 00:00:00 2001 From: emil28092005 Date: Thu, 18 Jun 2026 22:28:33 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20sphere=20collider=20matches=20visual=20s?= =?UTF-8?q?ize=20=E2=80=94=20create=20at=20radius=200.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: CreateSphere(r) baked scale into mesh radius, then Transform applied scale again → double scaling. Visual radius was scale*0.5*scale but collider was scale*0.5. Fix: always create sphere at radius 0.5 (unit sphere, like cube.obj). Scale is applied through Transform only. Collider radius = maxScale*0.5 matches visual radius = 0.5 * scale. --- src/Engine.AI/AiCommandProcessor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Engine.AI/AiCommandProcessor.cs b/src/Engine.AI/AiCommandProcessor.cs index 7995fef..ba78f39 100644 --- a/src/Engine.AI/AiCommandProcessor.cs +++ b/src/Engine.AI/AiCommandProcessor.cs @@ -85,8 +85,7 @@ public sealed class AiCommandProcessor Mesh mesh; if (isSphere) { - var r = MathF.Max(MathF.Max(command.Scale.X, command.Scale.Y), command.Scale.Z) * 0.5f; - mesh = ProceduralMesh.CreateSphere(r, 24, 12, new Vector3(0.5f, 0.6f, 0.9f)); + mesh = ProceduralMesh.CreateSphere(0.5f, 24, 12, new Vector3(0.5f, 0.6f, 0.9f)); } else {