< Summary

Information
Class: Gravitas.CollisionHandling.CollisionSatScratch
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/CollisionHandling/Detection/3D/CollisionSatScratch.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 59
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
get_SurfaceContactSnapshot3D()100%22100%
get_SurfaceContactSnapshot2D()100%22100%

File(s)

/home/runner/work/Gravitas/Gravitas/src/Gravitas/CollisionHandling/Detection/3D/CollisionSatScratch.cs

#LineLine coverage
 1//=======================================================================
 2// CollisionSatScratch.cs
 3//=======================================================================
 4// MIT License, Copyright (c) 2026-present David Oravsky (mrdav30)
 5// See LICENSE file in the project root for full license information.
 6//=======================================================================
 7
 8using System;
 9using FixedMathSharp;
 10using SwiftCollections;
 11
 12namespace Gravitas.CollisionHandling;
 13
 14/// <summary>
 15/// Owns reusable SAT and mesh-query buffers for one world context.
 16/// </summary>
 17internal sealed class CollisionSatScratch
 18{
 1019119    internal Vector3d[] PolyhedronVertices = Array.Empty<Vector3d>();
 2038220    internal int[] PolyhedronTriangles = Array.Empty<int>(), PolyhedronEdges = Array.Empty<int>();
 21    internal SwiftList<MeshTriangleContactGenerator.HullSample> HullSamples { get; } = new(8);
 22    internal SwiftList<Vector3d> ConvexPatchVertices { get; } = new();
 23    internal SwiftList<int> ConvexPatchTriangles { get; } = new();
 24    internal SwiftList<int> ConvexPatchEdges { get; } = new();
 25
 26    public SwiftList<int> MeshCylinderTriangles { get; } = new(8);
 27
 28    public SwiftList<int> MeshTriangleCandidatesA { get; } = new(16);
 29
 30    public SwiftList<int> MeshTriangleCandidatesB { get; } = new(16);
 31
 32    public SwiftHashSet<int> MeshSurfaces { get; } = new(8);
 33
 34    public MeshSurfaceConnectivity MeshConnectivity { get; } = new();
 35
 36    public MeshConeFaceRegions MeshConeFaces { get; } = new();
 37
 38    public MeshCapsuleFaceRegions MeshCapsuleFaces { get; } = new();
 39
 40    public MeshSlabFaceRegions MeshSlabFaces { get; } = new();
 41
 42    public MeshSlabSurfaceBoundary MeshSlabBoundary { get; } = new();
 43
 44    public MeshCapsuleSurfaceBoundary MeshCapsuleBoundary { get; } = new();
 45
 46    public MeshConeSurfaceBoundary MeshConeBoundary { get; } = new();
 47
 48    public ContactManifold MeshSurfaceManifold { get; } = new();
 49
 50    public ContactManifold CompoundPartManifold { get; } = new();
 51
 52    public ContactManifold MixedManifold { get; } = new();
 53
 54    // Pair refreshes borrow these only during synchronous narrow phase after a matrix edit.
 55    private ContactManifold? _surfaceContactSnapshot3D;
 556    internal ContactManifold SurfaceContactSnapshot3D => _surfaceContactSnapshot3D ??= new();
 57    private ContactManifold2D? _surfaceContactSnapshot2D;
 858    internal ContactManifold2D SurfaceContactSnapshot2D => _surfaceContactSnapshot2D ??= new();
 59}