< Summary

Information
Class: Gravitas.Diagnostics.GravitasMixedContactDiagnosticView
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/Diagnostics/Events/Contacts/GravitasMixedContactDiagnosticView.cs
Line coverage
100%
Covered lines: 17
Uncovered lines: 0
Coverable lines: 17
Total lines: 70
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_Collider3DId()100%11100%
get_Collider2DId()100%11100%
get_Collider3DDimension()100%11100%
get_Collider2DDimension()100%11100%
get_Collider3DType()100%11100%
get_Collider2DType()100%11100%
get_Point3D()100%11100%
get_Point2D()100%11100%
get_HasPoint3D()100%11100%
get_HasPoint2D()100%11100%
get_Normal3DTo2D()100%11100%
get_Depth()100%11100%
get_DepthIsClamped()100%11100%
get_HasContact()100%11100%

File(s)

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

#LineLine coverage
 1//=======================================================================
 2// GravitasMixedContactDiagnosticView.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 mixed 3D/2D contact diagnostic event.
 15/// </summary>
 16public readonly struct GravitasMixedContactDiagnosticView
 17{
 318    internal GravitasMixedContactDiagnosticView(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 context-local 3D collider identifier.</summary>
 130    public int Collider3DId => Event.ColliderAId;
 31
 32    /// <summary>Gets the context-local 2D collider identifier.</summary>
 133    public int Collider2DId => Event.ColliderBId;
 34
 35    /// <summary>Gets the 3D collider's dimension tag.</summary>
 136    public GravitasColliderDimension Collider3DDimension => Event.ColliderADimension;
 37
 38    /// <summary>Gets the 2D collider's dimension tag.</summary>
 139    public GravitasColliderDimension Collider2DDimension => Event.ColliderBDimension;
 40
 41    /// <summary>Gets the 3D collider type.</summary>
 142    public ColliderType Collider3DType => Event.ColliderAType;
 43
 44    /// <summary>Gets the 2D collider type.</summary>
 145    public ColliderType2D Collider2DType => Event.ColliderB2DType;
 46
 47    /// <summary>Gets the materialized contact point on the 3D collider.</summary>
 148    public Vector3d Point3D => Event.PointA;
 49
 50    /// <summary>Gets the materialized contact point on the 2D collider.</summary>
 151    public Vector3d Point2D => Event.PointB;
 52
 53    /// <summary>Gets whether <see cref="Point3D"/> contains a materialized point.</summary>
 154    public bool HasPoint3D => Event.HasPointA;
 55
 56    /// <summary>Gets whether <see cref="Point2D"/> contains a materialized point.</summary>
 157    public bool HasPoint2D => Event.HasPointB;
 58
 59    /// <summary>Gets the contact normal directed from the 3D collider toward the 2D collider.</summary>
 160    public Vector3d Normal3DTo2D => Event.Vector;
 61
 62    /// <summary>Gets the contact penetration depth.</summary>
 263    public Fixed64 Depth => Event.ScalarA;
 64
 65    /// <summary>Gets whether the reported penetration depth was clamped.</summary>
 166    public bool DepthIsClamped => Event.DataA != 0;
 67
 68    /// <summary>Gets whether the mixed collision produced a contact.</summary>
 169    public bool HasContact => Event.Hit;
 70}