Expand debug system pages and add noclip exploration
This commit is contained in:
1 parent
b915a2c2e4
commit
d7838980fd
20 files changed
+628
-47
No files matched your search
@@ -17,6 +17,18 @@ public sealed class SceneCollision
|
||||
private readonly Triangle[] triangles;
|
||||
public int TriangleCount => triangles.Length;
|
||||
|
||||
/// <summary>Modern debug exit check against the current capsule adapter.</summary>
|
||||
public bool CanOccupy(Vector3 feet, float radius, float height)
|
||||
{
|
||||
Validate(feet, Vector3.Zero, radius, height);
|
||||
CapsuleBounds(feet, radius, height, out var min, out var max);
|
||||
foreach (var triangle in triangles)
|
||||
if (Overlaps(min, max, triangle)
|
||||
&& Closest(feet, radius, height, triangle).DistanceSquared < (radius - Tolerance) * (radius - Tolerance))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private readonly record struct Triangle(Vector3 A, Vector3 B, Vector3 C,
|
||||
Vector3 Normal, Vector3 Min, Vector3 Max);
|
||||
private readonly record struct Hit(float Time, Vector3 Normal);
|
||||
|
||||
Reference in new issue
Block a user