Recover sphere response and correct Jimmy ceiling cancellation

This commit is contained in:
UnixNight committed 2026-10-26 16:09:19 -04:00
1 parent 6a7a53c90d
commit 57dfcc64bb
37 files changed
+1324 -18

No files matched your search

+15 -2
View File
@@ -20,7 +20,7 @@ public sealed class OriginalCameraRay
public const float CellOrigin = 130; //49B1FC.
private readonly Dictionary<int, List<SupportTriangle>> walls = [];
private readonly Dictionary<int, List<SupportTriangle>> all = [];
public bool Enabled { get; set; } = true; //4F69E5.
public bool Enabled { get; set; } = true; // Modern camera-only debug override.
public int PolygonCount { get; }
public int WallPolygonCount { get; }
/// <summary>Modern query diagnostic; repeated cells are intentionally counted.</summary>
@@ -88,12 +88,25 @@ public sealed class OriginalCameraRay
RequireFinite(start); RequireFinite(end);
LastTriangleTests = 0;
if (!Enabled) return null;
return TraceCore(start, end, twoSided, diagnostic: true);
}
/// <summary>425170 also uses47C210. Camera-only debug controls must not
/// disable physical ceiling checks or overwrite camera-query diagnostics.</summary>
public SupportHit? TraceGeometry(Vector3 start, Vector3 end, bool twoSided = false)
{
RequireFinite(start); RequireFinite(end);
return TraceCore(start, end, twoSided, diagnostic: false);
}
private SupportHit? TraceCore(Vector3 start, Vector3 end, bool twoSided, bool diagnostic)
{
foreach (var grid in new[] { walls, all })
foreach (var cell in CellsBetween(start, end))
if (grid.TryGetValue(cell, out var triangles))
foreach (var triangle in triangles)
{
LastTriangleTests++;
if (diagnostic) LastTriangleTests++;
if (OriginalBodySupport.IntersectSegment(triangle, start, end, twoSided) is { } hit)
return hit;
}