< Summary

Information
Class: Gravitas.Diagnostics.GravitasContactDiagnosticView
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/Diagnostics/Events/Contacts/GravitasContactDiagnosticView.cs
Line coverage
100%
Covered lines: 16
Uncovered lines: 0
Coverable lines: 16
Total lines: 67
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
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_Frame()100%11100%
get_Sequence()100%11100%
get_ColliderAId()100%11100%
get_ColliderBId()100%11100%
get_ColliderAType()100%11100%
get_ColliderBType()100%11100%
get_PointA()100%11100%
get_PointB()100%11100%
get_HasPointA()100%11100%
get_HasPointB()100%11100%
get_Normal()100%11100%
get_Depth()100%11100%
get_ContactCount()100%11100%
get_DepthIsClamped()100%11100%
get_HasContact()100%11100%

File(s)

/home/runner/work/Gravitas/Gravitas/src/Gravitas/Diagnostics/Events/Contacts/GravitasContactDiagnosticView.cs

#LineLine coverage
 1//=======================================================================
 2// GravitasContactDiagnosticView.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 FixedMathSharp;
 9using Gravitas.Colliders;
 10
 11namespace Gravitas.Diagnostics;
 12
 13/// <summary>
 14/// Typed read-only view over a 3D contact diagnostic event.
 15/// </summary>
 16public readonly struct GravitasContactDiagnosticView
 17{
 418    internal GravitasContactDiagnosticView(GravitasDiagnosticEvent diagnosticEvent) => Event = diagnosticEvent;
 19
 20    /// <summary>Gets the underlying diagnostic event.</summary>
 21    public GravitasDiagnosticEvent Event { get; }
 22
 23    /// <summary>Gets the simulation frame in which the contact was captured.</summary>
 124    public long Frame => Event.Frame;
 25
 26    /// <summary>Gets the event's sequence within its capture buffer.</summary>
 127    public int Sequence => Event.Sequence;
 28
 29    /// <summary>Gets the first context-local collider identifier.</summary>
 130    public int ColliderAId => Event.ColliderAId;
 31
 32    /// <summary>Gets the second context-local collider identifier.</summary>
 133    public int ColliderBId => Event.ColliderBId;
 34
 35    /// <summary>Gets the first collider type.</summary>
 136    public ColliderType ColliderAType => Event.ColliderAType;
 37
 38    /// <summary>Gets the second collider type.</summary>
 139    public ColliderType ColliderBType => Event.ColliderBType;
 40
 41    /// <summary>Gets the materialized contact point on the first collider.</summary>
 142    public Vector3d PointA => Event.PointA;
 43
 44    /// <summary>Gets the materialized contact point on the second collider.</summary>
 145    public Vector3d PointB => Event.PointB;
 46
 47    /// <summary>Gets whether <see cref="PointA"/> contains a materialized point.</summary>
 248    public bool HasPointA => Event.HasPointA;
 49
 50    /// <summary>Gets whether <see cref="PointB"/> contains a materialized point.</summary>
 251    public bool HasPointB => Event.HasPointB;
 52
 53    /// <summary>Gets the contact normal.</summary>
 154    public Vector3d Normal => Event.Vector;
 55
 56    /// <summary>Gets the contact penetration depth.</summary>
 157    public Fixed64 Depth => Event.ScalarA;
 58
 59    /// <summary>Gets the number of contacts in the manifold.</summary>
 160    public int ContactCount => Event.DataA;
 61
 62    /// <summary>Gets whether the reported penetration depth was clamped.</summary>
 263    public bool DepthIsClamped => Event.DataB != 0;
 64
 65    /// <summary>Gets whether the collision produced a contact.</summary>
 266    public bool HasContact => Event.Hit;
 67}