diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 1831713..7db0c83 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -1810,16 +1810,21 @@ public sealed class GameWindow : IDisposable if (setup is not null && setup.CylSpheres.Count > 0) { var cyl = setup.CylSpheres[0]; - float cylRadius = cyl.Radius > 0 ? cyl.Radius : setup.Radius; + // Use the LARGER of CylSphere.Radius and Setup.Radius. + // Setup.Radius is the overall bounding radius of the object. + float cylRadius = MathF.Max(cyl.Radius, setup.Radius); + if (cylRadius <= 0) cylRadius = 1f; + float cylHeight = cyl.Height > 0 ? cyl.Height : setup.Height; + if (cylHeight <= 0) cylHeight = cylRadius * 4f; + if (cylRadius > 0) { - // Use entity.Id directly (not partId) for the CylSphere entry. _physicsEngine.ShadowObjects.Register( entity.Id, entity.SourceGfxObjOrSetupId, entity.Position + new System.Numerics.Vector3(cyl.Origin.X, cyl.Origin.Y, cyl.Origin.Z), entity.Rotation, cylRadius, origin.X, origin.Y, lb.LandblockId, - AcDream.Core.Physics.ShadowCollisionType.Cylinder, cyl.Height); + AcDream.Core.Physics.ShadowCollisionType.Cylinder, cylHeight); } } else if (setup is not null && setup.Spheres.Count > 0 && partIndex == 0)