fix: sphere collider matches visual size — create at radius 0.5

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.
This commit is contained in:
emil28092005
2026-06-18 22:28:33 +03:00
parent 243e430eab
commit 4eb0584f6d
+1 -2
View File
@@ -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
{