< Summary

Information
Class: Gravitas.CollisionHandling.MeshConeSurfaceBoundary
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/CollisionHandling/Detection/3D/Mesh/Surfaces/MeshConeSurfaceBoundary.cs
Line coverage
100%
Covered lines: 179
Uncovered lines: 0
Coverable lines: 179
Total lines: 369
Line coverage: 100%
Branch coverage
100%
Covered branches: 168
Total branches: 168
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_IsolatedCount()100%11100%
get_FamilyCount()100%11100%
get_FamilySampleCount()100%11100%
Build(...)100%22100%
BuildSurfaceContacts(...)100%3434100%
ReduceSurfaceFeature(...)100%4444100%
CompareCoverage(...)100%44100%
GetIsolatedContact(...)100%11100%
GetIsolatedVertex(...)100%44100%
Accumulate(...)100%3434100%
GetFamilySampleContact(...)100%11100%
TryGetFamilySampleWorldAnchors(...)100%22100%
KeepFamily(...)100%2424100%
SupportsIncidentFan(...)100%2020100%
Negate(...)100%11100%
.ctor(...)100%11100%
.ctor(...)100%11100%
.ctor(...)100%11100%
.ctor(...)100%11100%

File(s)

/home/runner/work/Gravitas/Gravitas/src/Gravitas/CollisionHandling/Detection/3D/Mesh/Surfaces/MeshConeSurfaceBoundary.cs

#LineLine coverage
 1//=======================================================================
 2// MeshConeSurfaceBoundary.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 FixedMathSharp.Geometry;
 11using Gravitas.Colliders;
 12using SwiftCollections;
 13
 14namespace Gravitas.CollisionHandling;
 15
 16/// <summary>Retains finite exposed-feature certificates for one prepared mesh surface.</summary>
 17internal sealed class MeshConeSurfaceBoundary
 18{
 1021219    private readonly SwiftList<BoundaryCandidate> _isolated = new();
 1021220    private readonly SwiftList<FamilyCandidate> _families = new();
 1021221    private readonly SwiftList<FamilySample> _familySamples = new();
 1021222    private readonly SwiftList<WideAxis3> _halfspaces = new();
 23    private RationalSegmentInterval _clip;
 1021224    private WideAxis3[] _joinedFan = Array.Empty<WideAxis3>();
 1021225    private ConeSurfaceFamilyEvent[] _familyStorage = Array.Empty<ConeSurfaceFamilyEvent>();
 1021226    private readonly SwiftHashSet<int> _visitedCorners = new();
 1021227    private readonly SwiftList<SurfaceSample> _surfacePool = new();
 28
 78829    internal int IsolatedCount => _isolated.Count;
 630    internal int FamilyCount => _families.Count;
 19431    internal int FamilySampleCount => _familySamples.Count;
 32
 33    internal void Build(PhysicsMesh mesh, int surfaceTriangle, Vector3d coneCenter,
 34        FixedQuaternion coneRotation, Fixed64 height, Fixed64 radius)
 35    {
 16436        _isolated.FastClear(); _families.FastClear(); _familySamples.FastClear(); _halfspaces.FastClear();
 4137        ReadOnlySpan<int> boundary = mesh.GetCanonicalSurfaceBoundaryVertexPairs(surfaceTriangle);
 4138        ReadOnlySpan<Vector3d> vertices = mesh.GeometryVertices;
 4139        int owner = mesh.GetManifoldSurfaceOwner(surfaceTriangle);
 4140        Span<SegmentConeSurfaceCandidate> storage = stackalloc SegmentConeSurfaceCandidate[SegmentConeSurfaceCandidates.
 36241        for (int edge = 0; edge < boundary.Length; edge += 2)
 14042            Accumulate(mesh, owner, boundary[edge], boundary[edge + 1], vertices,
 14043                coneCenter, coneRotation, height, radius, storage);
 4144    }
 45
 46    /// <summary>Adds independently reduced true-edge and corner constraints to the unpublished manifold.</summary>
 47    internal void BuildSurfaceContacts(LSMeshCollider meshCollider, LSConeCollider cone, int surfaceTriangle,
 48        MeshSurfaceConnectivity connectivity, MeshConeFaceRegions faces, ContactManifold manifold)
 49    {
 37250        PhysicsMesh mesh = meshCollider.Mesh;
 37251        ConePlaneRayFrame frame = faces.GetBoundaryFrame(meshCollider, surfaceTriangle);
 37252        WideDirection3d worldNormal = new WideDirection3d(frame.AuthoredNormal).Transform(mesh.GeometryFrame.GeometryBas
 37253        WideAxis3 normal = new(Signed320.NarrowValue(worldNormal.X), Signed320.NarrowValue(worldNormal.Y), Signed320.Nar
 74454        int owner = mesh.GetManifoldSurfaceOwner(surfaceTriangle), surface = mesh.GetCanonicalSurfaceOrdinal(surfaceTria
 37255        ReadOnlySpan<int> boundary = mesh.GetCanonicalSurfaceBoundaryVertexPairs(surfaceTriangle);
 37256        ReadOnlySpan<Vector3d> vertices = mesh.GeometryVertices;
 37257        _visitedCorners.Clear();
 37258        MeshSurfaceBoundaryDomain? domain = faces.GetJoinedBoundary(meshCollider, surfaceTriangle);
 37259        if (domain != null)
 60        {
 42661            for (int span = 0; span < domain.Spans.Length; span++)
 62            {
 17463                var piece = domain.Spans[span];
 17464                if (faces.IsJoinedSpan(meshCollider, surfaceTriangle, span) || !frame.IntersectsSegment(new FixedSegment
 5865                int region = connectivity.RegionCount == 1 ? 0
 5866                    : MeshSurfaceBoundaryTopology.FindEdgeRegion(mesh, owner, piece.First, piece.Second, connectivity, f
 5867                int feature = checked(3 * span);
 5868                RationalSegmentInterval clip = faces.GetRetainedBoundaryInterval(meshCollider, surfaceTriangle, ref span
 69                // An intersecting canonical perimeter belongs to an admitted incident triangle.
 70                System.Diagnostics.Debug.Assert(region >= 0);
 5871                KeepSurfaceFeature(piece.First, piece.Second, feature, region, false, clip);
 72            }
 73            // A certified exposed/joined transition lies at an authored
 74            // canonical vertex of an incident member, even across rigid frames.
 75            // Visit those actual vertices; never round a rational cut into one.
 41476            for (int edge = 0; edge < boundary.Length; edge += 2)
 77            {
 33678                int first = boundary[edge], second = boundary[edge + 1];
 16879                int region = MeshSurfaceBoundaryTopology.FindEdgeRegion(mesh, owner, first, second, connectivity, frame)
 16880                if (region < 0) continue;
 8481                if (_visitedCorners.Add(first) && frame.ContainsPoint(vertices[first]))
 1082                    KeepSurfaceFeature(first, second, checked(3 * (domain.Spans.Length + edge / 2) + 1), region, true);
 8483                if (_visitedCorners.Add(second) && frame.ContainsPoint(vertices[second]))
 2584                    KeepSurfaceFeature(second, first, checked(3 * (domain.Spans.Length + edge / 2) + 2), region, true);
 85            }
 3986            return;
 87        }
 327288        for (int edge = 0; edge < boundary.Length; edge += 2)
 89        {
 260690            int first = boundary[edge], second = boundary[edge + 1];
 130391            int feature = checked(3 * (edge / 2));
 130392            int region = MeshSurfaceBoundaryTopology.FindEdgeRegion(mesh, owner, first, second, connectivity, frame);
 216793            if (region >= 0) KeepSurfaceFeature(first, second, feature, region, pointOnly: false);
 130394            if (_visitedCorners.Add(first) && frame.ContainsPoint(vertices[first]))
 95            {
 96                // A convex cone cuts this straight edge in one connected
 97                // interval. Its admitted authored subedges join through their
 98                // welded endpoints, so this corner shares the edge's region.
 99                System.Diagnostics.Debug.Assert(region >= 0);
 160100                KeepSurfaceFeature(first, second, feature + 1, region, pointOnly: true);
 101            }
 1303102            if (_visitedCorners.Add(second) && frame.ContainsPoint(vertices[second]))
 103            {
 104                System.Diagnostics.Debug.Assert(region >= 0);
 403105                KeepSurfaceFeature(second, first, feature + 2, region, pointOnly: true);
 106            }
 107        }
 108
 109        void KeepSurfaceFeature(int first, int second, int feature, int region, bool pointOnly,
 110            in RationalSegmentInterval clip = default)
 111        {
 112            bool suppress = false;
 113            ReadOnlySpan<WideAxis3> fan = domain != null && pointOnly
 114                ? faces.GetJoinedCornerFan(meshCollider, surfaceTriangle, first, out suppress) : default;
 115            if (suppress) return;
 116            _isolated.FastClear(); _families.FastClear(); _familySamples.FastClear(); _halfspaces.FastClear();
 117            WideAxis3 selectedExit = faces.GetBoundaryOrientation(meshCollider, surfaceTriangle, region) > 0 ? normal : 
 118            // Use a point segment for each corner exactly once. Adjacent edges
 119            // must not duplicate its support branches or multiply its pressure.
 120            Span<SegmentConeSurfaceCandidate> featureStorage = stackalloc SegmentConeSurfaceCandidate[SegmentConeSurface
 121            Accumulate(mesh, owner, first, second, mesh.GeometryVertices, cone.Center, cone.Rotation,
 122                cone.Height, cone.ScaledRadius, featureStorage, interiorOnly: !pointOnly, pointOnly, selectedExit, clip,
 123            ReduceSurfaceFeature(meshCollider, cone, surface, feature, faces.SamplingOrigin, manifold);
 124        }
 333125    }
 126
 127    private void ReduceSurfaceFeature(LSMeshCollider mesh, LSConeCollider cone, int surface, int feature,
 128        Vector3d samplingOrigin, ContactManifold manifold)
 129    {
 1506130        _surfacePool.FastClear();
 2182131        if (_isolated.Count == 0 && _families.Count == 0) return;
 830132        SegmentConeSurfaceCandidate minimum = _isolated.Count > 0
 830133            ? _isolated[0].Certificate : _families[0].Candidate.Certificate;
 3140134        foreach (BoundaryCandidate candidate in _isolated.AsReadOnlySpan())
 883135            if (SegmentConeSurfaceCandidates.CompareDepths(candidate.Certificate, minimum) < 0) minimum = candidate.Cert
 2678136        foreach (FamilyCandidate family in _families.AsReadOnlySpan())
 746137            if (SegmentConeSurfaceCandidates.CompareDepths(family.Candidate.Certificate, minimum) < 0) minimum = family.
 138        // A feature's support strata are alternative exits, not simultaneous
 139        // constraints. Retain its exact lower envelope before rounding; a far
 140        // apex exit cannot depenetrate a touching or barely penetrating side.
 141        // Clipped families retain their source certificate's constant depth.
 830142        Span<bool> coMinimalFamilies = stackalloc bool[SegmentConeSurfaceCandidates.MaximumCandidates];
 143        System.Diagnostics.Debug.Assert(_families.Count <= coMinimalFamilies.Length);
 2678144        for (int index = 0; index < _families.Count; index++)
 509145            coMinimalFamilies[index] = SegmentConeSurfaceCandidates.CompareDepths(_families[index].Candidate.Certificate
 3140146        for (int index = 0; index < _isolated.Count; index++)
 1093147            if (SegmentConeSurfaceCandidates.CompareDepths(_isolated[index].Certificate, minimum) == 0) Keep(GetIsolated
 3118148        for (int index = 0; index < _familySamples.Count; index++)
 1412149            if (coMinimalFamilies[_familySamples[index].Family]) Keep(GetFamilySampleContact(index));
 150        // Each retained family emitted at least one admitted sample. A minimum
 151        // family or isolated certificate therefore seeds this pool before any
 152        // duplicate can be discarded.
 153        System.Diagnostics.Debug.Assert(_surfacePool.Count > 0);
 830154        Span<int> chosen = stackalloc int[ContactManifold.MaxContactsPerGroup];
 155        // All survivors have the same exact depth. Their canonical construction
 156        // order supplies the first sample; coverage chooses the remaining three.
 830157        chosen[0] = 0;
 830158        int count = Math.Min(ContactManifold.MaxContactsPerGroup, _surfacePool.Count);
 1892159        for (int slot = 1; slot < count; slot++)
 160        {
 232161            int best = -1, bestNearest = 0;
 824162            for (int candidate = 0; candidate < _surfacePool.Count; candidate++)
 163            {
 296164                if (chosen[..slot].IndexOf(candidate) >= 0) continue;
 151165                int nearest = chosen[0];
 376166                for (int prior = 1; prior < slot; prior++)
 41167                    if (CompareCoverage(candidate, chosen[prior], candidate, nearest) < 0) nearest = chosen[prior];
 151168                if (best < 0 || CompareCoverage(candidate, nearest, best, bestNearest) > 0)
 286169                { best = candidate; bestNearest = nearest; }
 170            }
 116171            chosen[slot] = best;
 172        }
 173        // Negative feature ordinals are disjoint from nonnegative face regions.
 174        // Four samples approximate this feature's distributed response. Final
 175        // rounded coverage never feeds back into exact admission or depth selection.
 176        // Coverage ranks only the admitted finite pool: normal spread first
 177        // (a touch family can share both anchors), then mesh/cone anchor spread.
 830178        bool joined = mesh.StaticSurface != null;
 830179        var key = new ContactGroupKey(0, 0, surface, 0, checked(-feature - 1),
 830180            sourceIdA: joined ? mesh.Id + 1 : 0,
 830181            sourceOrderA: joined ? ((IPhysicsColliderRegistryItem)mesh).ReplayOrder + 1 : 0);
 3552182        for (int slot = 0; slot < count; slot++)
 183        {
 946184            FixedContactAnchors contact = _surfacePool[chosen[slot]].Contact;
 946185            manifold.AddContact(new ContactAnchor(contact.FirstAnchor), new ContactAnchor(contact.SecondAnchor),
 946186                contact.Depth, contact.Normal, mesh.Material, cone.Material, contact.DepthIsClamped,
 946187                group: key, sampleIdentity: slot + 1);
 188        }
 189
 190        void Keep(FixedContactAnchors contact)
 191        {
 192            if (!contact.FirstAnchor.TryGetPointInFrame(samplingOrigin, out Vector3d p)
 193                || !contact.SecondAnchor.TryGetPointInFrame(samplingOrigin, out Vector3d q))
 194                throw new OverflowException("An admitted boundary sample is outside the Fixed64 sampling range.");
 195            // Distinct exact constructions can round to the same solver row.
 196            // Collapse that final redundancy after admission; different normals
 197            // at coincident touch anchors remain independent samples.
 198            for (int index = 0; index < _surfacePool.Count; index++)
 199            {
 200                SurfaceSample existing = _surfacePool[index];
 201                if (existing.MeshPoint != p || existing.ConePoint != q || existing.Contact.Normal != contact.Normal) con
 202                return;
 203            }
 204            _surfacePool.Add(new SurfaceSample(contact, p, q));
 205        }
 830206    }
 207
 208    private int CompareCoverage(int first, int firstReference, int second, int secondReference)
 209    {
 144210        SurfaceSample a = _surfacePool[first], ar = _surfacePool[firstReference];
 144211        SurfaceSample b = _surfacePool[second], br = _surfacePool[secondReference];
 72212        int comparison = Vector3d.CompareDistanceSquared(a.Contact.Normal, ar.Contact.Normal, b.Contact.Normal, br.Conta
 114213        if (comparison == 0) comparison = Vector3d.CompareDistanceSquared(a.MeshPoint, ar.MeshPoint, b.MeshPoint, br.Mes
 72214        return comparison == 0 ? Vector3d.CompareDistanceSquared(a.ConePoint, ar.ConePoint, b.ConePoint, br.ConePoint) :
 215    }
 216
 1069217    internal FixedContactAnchors GetIsolatedContact(int index) => _isolated[index].Certificate.GetContact();
 218
 219    internal int GetIsolatedVertex(int index)
 220    {
 94221        BoundaryCandidate candidate = _isolated[index];
 94222        return candidate.Certificate.PointLocation == ConeSurfacePointLocation.Start ? candidate.First
 94223            : candidate.Certificate.PointLocation == ConeSurfacePointLocation.End ? candidate.Second : -1;
 224    }
 225
 226    private void Accumulate(PhysicsMesh mesh, int owner, int first, int second, ReadOnlySpan<Vector3d> vertices,
 227        Vector3d coneCenter, FixedQuaternion coneRotation, Fixed64 height, Fixed64 radius,
 228        Span<SegmentConeSurfaceCandidate> storage, bool interiorOnly = false, bool pointOnly = false, WideAxis3? selecte
 229        in RationalSegmentInterval clip = default, ReadOnlySpan<WideAxis3> joinedFan = default)
 230    {
 231        // The boundary owner reduces one clipped feature before visiting the next.
 1646232        _clip = clip;
 1646233        var selection = new ConeSurfaceSelection(storage);
 1646234        SegmentConeSurfaceCandidates.AccumulateSegmentConeSurfaceCandidates(
 1646235            new FixedSegment(vertices[first], vertices[pointOnly ? first : second]), mesh.GeometryFrame,
 1646236            coneCenter, coneRotation, height, radius, ref selection);
 23928237        for (int index = 0; index < selection.Count; index++)
 238        {
 10318239            SegmentConeSurfaceCandidate certificate = selection[index];
 240            // Both endpoints of a point segment are the same corner. Retain
 241            // its construction, but use Start for the real incident-edge fan.
 10318242            if (pointOnly && certificate.PointLocation != ConeSurfacePointLocation.Start)
 584243                certificate = new SegmentConeSurfaceCandidate(certificate.Input, certificate.Feature, certificate.Family
 584244                    certificate.Chart, certificate.RootOrdinal, ConeSurfacePointLocation.Start);
 10318245            var candidate = new BoundaryCandidate(first, second, certificate);
 10318246            if (clip.IsClipped && certificate.Family != ConeSurfaceFamily.SegmentInterval
 10318247                && !certificate.IsInInterval(clip, interiorOnly)) continue;
 10298248            if (interiorOnly && candidate.Certificate.Family != ConeSurfaceFamily.SegmentInterval
 10298249                && candidate.Certificate.PointLocation != ConeSurfacePointLocation.Interior) continue;
 7128250            if (candidate.Certificate.Family == ConeSurfaceFamily.None)
 251            {
 7366252                if (SupportsIncidentFan(mesh, owner, candidate, vertices, selectedExit, joinedFan)) _isolated.Add(candid
 253            }
 1403254            else if (candidate.Certificate.Family == ConeSurfaceFamily.SegmentInterval)
 255            {
 2032256                if (!interiorOnly) KeepFamily(mesh, owner, candidate, vertices, ConeSurfacePointLocation.Start, selected
 2066257                if (!pointOnly) KeepFamily(mesh, owner, candidate, vertices, ConeSurfacePointLocation.Interior, selected
 1448258                if (!interiorOnly && !pointOnly) KeepFamily(mesh, owner, candidate, vertices, ConeSurfacePointLocation.E
 259            }
 78260            else KeepFamily(mesh, owner, candidate, vertices, candidate.Certificate.PointLocation, selectedExit, clip, j
 261        }
 1646262    }
 263
 264    internal FixedContactAnchors GetFamilySampleContact(int index)
 265    {
 774266        FamilySample sample = _familySamples[index];
 772267        FamilyCandidate family = _families[sample.Family];
 772268        return sample.Event.GetContact(family.Candidate.Certificate,
 772269            _halfspaces.AsReadOnlySpan().Slice(family.Offset, family.Count), _clip);
 270    }
 271
 272    internal bool TryGetFamilySampleWorldAnchors(int index, out Vector3d first, out Vector3d second)
 273    {
 117274        first = second = default;
 121275        if ((uint)index >= (uint)_familySamples.Count) return false;
 113276        FamilySample sample = _familySamples[index];
 113277        FamilyCandidate family = _families[sample.Family];
 113278        return sample.Event.TryGetWorldAnchors(family.Candidate.Certificate,
 113279            _halfspaces.AsReadOnlySpan().Slice(family.Offset, family.Count), _clip, out first, out second);
 280    }
 281
 282    private void KeepFamily(PhysicsMesh mesh, int owner, BoundaryCandidate candidate,
 283        ReadOnlySpan<Vector3d> vertices, ConeSurfacePointLocation location, WideAxis3? selectedExit = null,
 284        in RationalSegmentInterval clip = default, ReadOnlySpan<WideAxis3> joinedFan = default)
 285    {
 1662286        if (!joinedFan.IsEmpty && _joinedFan.Length < joinedFan.Length + 1) Array.Resize(ref _joinedFan, joinedFan.Lengt
 1649287        Span<WideAxis3> fan = joinedFan.IsEmpty ? stackalloc WideAxis3[5] : _joinedFan;
 288        int count;
 3255289        if (joinedFan.IsEmpty) count = MeshSurfaceBoundaryTopology.GetIncidentFan(mesh, owner,
 1606290            location == ConeSurfacePointLocation.End ? candidate.Second : candidate.First,
 1606291            location == ConeSurfacePointLocation.End ? candidate.First : candidate.Second,
 1606292            location == ConeSurfacePointLocation.Interior, fan);
 86293        else { joinedFan.CopyTo(fan); count = joinedFan.Length; }
 1649294        if (joinedFan.IsEmpty)
 15353295            for (int index = 0; index < count; index++) fan[index] = mesh.GeometryFrame.GetWorldDirectionNumerators(fan[
 2909296        if (selectedExit.HasValue) fan[count++] = selectedExit.Value;
 1649297        int capacity = candidate.Certificate.GetMaximumFamilyEventCount(count);
 1752298        if (_familyStorage.Length < capacity) Array.Resize(ref _familyStorage, capacity);
 1649299        var selection = new ConeSurfaceFamilySelection(_familyStorage);
 2444300        if (!candidate.Certificate.AccumulateFamilyEvents(fan[..count], location, clip, ref selection)) return;
 854301        int family = _families.Count;
 854302        _families.Add(new FamilyCandidate(candidate, _halfspaces.Count, count));
 854303        _halfspaces.AddRange(fan[..count]);
 3992304        for (int index = 0; index < selection.Count; index++)
 1142305            _familySamples.Add(new FamilySample(family, selection[index]));
 854306    }
 307
 308    private static bool SupportsIncidentFan(PhysicsMesh mesh, int owner, BoundaryCandidate candidate,
 309        ReadOnlySpan<Vector3d> vertices, WideAxis3? selectedExit = null, ReadOnlySpan<WideAxis3> joinedFan = default)
 310    {
 5725311        Span<WideAxis3> localFan = stackalloc WideAxis3[5];
 5725312        int count = joinedFan.IsEmpty ? MeshSurfaceBoundaryTopology.GetIncidentFan(mesh, owner,
 5725313            candidate.Certificate.PointLocation == ConeSurfacePointLocation.End ? candidate.Second : candidate.First,
 5725314            candidate.Certificate.PointLocation == ConeSurfacePointLocation.End ? candidate.First : candidate.Second,
 5725315            candidate.Certificate.PointLocation == ConeSurfacePointLocation.Interior, localFan) : joinedFan.Length;
 5725316        if (joinedFan.IsEmpty)
 52739317            for (int index = 0; index < count; index++) localFan[index] = mesh.GeometryFrame.GetWorldDirectionNumerators
 5725318        if (selectedExit.HasValue)
 319        {
 4580320            bool hasExit = candidate.Certificate.TryGetNormalDotSign(selectedExit.Value, out int exitSign);
 321            System.Diagnostics.Debug.Assert(hasExit);
 7002322            if (exitSign > 0) return false;
 323        }
 3303324        ReadOnlySpan<WideAxis3> fan = joinedFan.IsEmpty ? localFan[..count] : joinedFan;
 19614325        foreach (WideAxis3 ray in fan)
 326        {
 7335327            bool hasNormal = candidate.Certificate.TryGetNormalDotSign(ray, out int sign);
 328            System.Diagnostics.Debug.Assert(hasNormal);
 8997329            if (sign > 0) return false;
 330        }
 1641331        return true;
 332    }
 333
 489334    private static WideAxis3 Negate(WideAxis3 value) => new(
 489335        WideArithmetic.Negate(value.X), WideArithmetic.Negate(value.Y), WideArithmetic.Negate(value.Z));
 336
 337    private readonly struct FamilyCandidate
 338    {
 339        internal readonly BoundaryCandidate Candidate;
 340        internal readonly int Offset, Count;
 341        internal FamilyCandidate(BoundaryCandidate candidate, int offset, int count)
 3416342        { Candidate = candidate; Offset = offset; Count = count; }
 343    }
 344
 345    private readonly struct FamilySample
 346    {
 347        internal readonly int Family;
 348        internal readonly ConeSurfaceFamilyEvent Event;
 3426349        internal FamilySample(int family, ConeSurfaceFamilyEvent descriptor) { Family = family; Event = descriptor; }
 350    }
 351
 352    private readonly struct BoundaryCandidate
 353    {
 354        internal readonly int First, Second;
 355        internal readonly SegmentConeSurfaceCandidate Certificate;
 356        internal BoundaryCandidate(int first, int second, SegmentConeSurfaceCandidate certificate)
 357        {
 30954358            First = first; Second = second; Certificate = certificate;
 10318359        }
 360    }
 361
 362    private readonly struct SurfaceSample
 363    {
 364        internal readonly FixedContactAnchors Contact;
 365        internal readonly Vector3d MeshPoint, ConePoint;
 366        internal SurfaceSample(FixedContactAnchors contact, Vector3d meshPoint, Vector3d conePoint)
 3792367        { Contact = contact; MeshPoint = meshPoint; ConePoint = conePoint; }
 368    }
 369}

Methods/Properties

.ctor()
get_IsolatedCount()
get_FamilyCount()
get_FamilySampleCount()
Build(Gravitas.Colliders.PhysicsMesh,System.Int32,FixedMathSharp.Vector3d,FixedMathSharp.FixedQuaternion,FixedMathSharp.Fixed64,FixedMathSharp.Fixed64)
BuildSurfaceContacts(Gravitas.Colliders.LSMeshCollider,Gravitas.Colliders.LSConeCollider,System.Int32,Gravitas.CollisionHandling.MeshSurfaceConnectivity,Gravitas.CollisionHandling.MeshConeFaceRegions,Gravitas.CollisionHandling.ContactManifold)
ReduceSurfaceFeature(Gravitas.Colliders.LSMeshCollider,Gravitas.Colliders.LSConeCollider,System.Int32,System.Int32,FixedMathSharp.Vector3d,Gravitas.CollisionHandling.ContactManifold)
CompareCoverage(System.Int32,System.Int32,System.Int32,System.Int32)
GetIsolatedContact(System.Int32)
GetIsolatedVertex(System.Int32)
Accumulate(Gravitas.Colliders.PhysicsMesh,System.Int32,System.Int32,System.Int32,System.ReadOnlySpan`1<FixedMathSharp.Vector3d>,FixedMathSharp.Vector3d,FixedMathSharp.FixedQuaternion,FixedMathSharp.Fixed64,FixedMathSharp.Fixed64,System.Span`1<FixedMathSharp.Geometry.SegmentConeSurfaceCandidate>,System.Boolean,System.Boolean,System.Nullable`1<FixedMathSharp.Geometry.WideAxis3>,FixedMathSharp.Geometry.RationalSegmentInterval&,System.ReadOnlySpan`1<FixedMathSharp.Geometry.WideAxis3>)
GetFamilySampleContact(System.Int32)
TryGetFamilySampleWorldAnchors(System.Int32,FixedMathSharp.Vector3d&,FixedMathSharp.Vector3d&)
KeepFamily(Gravitas.Colliders.PhysicsMesh,System.Int32,Gravitas.CollisionHandling.MeshConeSurfaceBoundary/BoundaryCandidate,System.ReadOnlySpan`1<FixedMathSharp.Vector3d>,FixedMathSharp.Geometry.ConeSurfacePointLocation,System.Nullable`1<FixedMathSharp.Geometry.WideAxis3>,FixedMathSharp.Geometry.RationalSegmentInterval&,System.ReadOnlySpan`1<FixedMathSharp.Geometry.WideAxis3>)
SupportsIncidentFan(Gravitas.Colliders.PhysicsMesh,System.Int32,Gravitas.CollisionHandling.MeshConeSurfaceBoundary/BoundaryCandidate,System.ReadOnlySpan`1<FixedMathSharp.Vector3d>,System.Nullable`1<FixedMathSharp.Geometry.WideAxis3>,System.ReadOnlySpan`1<FixedMathSharp.Geometry.WideAxis3>)
Negate(FixedMathSharp.Geometry.WideAxis3)
.ctor(Gravitas.CollisionHandling.MeshConeSurfaceBoundary/BoundaryCandidate,System.Int32,System.Int32)
.ctor(System.Int32,FixedMathSharp.Geometry.ConeSurfaceFamilyEvent)
.ctor(System.Int32,System.Int32,FixedMathSharp.Geometry.SegmentConeSurfaceCandidate)
.ctor(FixedMathSharp.Geometry.FixedContactAnchors,FixedMathSharp.Vector3d,FixedMathSharp.Vector3d)