< Summary

Information
Class: Gravitas.Diagnostics.GravitasJointDiagnosticView
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/Diagnostics/Events/Constraints/GravitasJointDiagnosticView.cs
Line coverage
100%
Covered lines: 23
Uncovered lines: 0
Coverable lines: 23
Total lines: 84
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
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_Frame()100%11100%
get_Sequence()100%11100%
get_Kind()100%11100%
get_JointId()100%11100%
get_ColliderAId()100%11100%
get_ColliderBId()100%11100%
get_ColliderADimension()100%11100%
get_ColliderBDimension()100%11100%
get_ColliderAType()100%11100%
get_ColliderBType()100%11100%
get_ColliderA2DType()100%11100%
get_ColliderB2DType()100%11100%
get_ImpulseMagnitude()100%11100%
get_LimitError()100%22100%
get_LinearAnchorErrorMagnitude()100%11100%
get_MotorImpulseMagnitude()100%11100%
get_MotorErrorMagnitude()100%11100%
get_LimitErrorMagnitude()100%11100%
get_RowCount()100%11100%
get_ClampedRowCount()100%11100%

File(s)

/home/runner/work/Gravitas/Gravitas/src/Gravitas/Diagnostics/Events/Constraints/GravitasJointDiagnosticView.cs

#LineLine coverage
 1//=======================================================================
 2// GravitasJointDiagnosticView.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 joint diagnostic event.
 15/// </summary>
 16public readonly struct GravitasJointDiagnosticView
 17{
 10818    internal GravitasJointDiagnosticView(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 joint event 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 joint event kind.</summary>
 9930    public GravitasDiagnosticEventKind Kind => Event.Kind;
 31
 32    /// <summary>Gets the context-local joint identifier.</summary>
 433    public int JointId => Event.JointId;
 34
 35    /// <summary>Gets the first endpoint's context-local collider identifier.</summary>
 136    public int ColliderAId => Event.ColliderAId;
 37
 38    /// <summary>Gets the second endpoint's context-local collider identifier.</summary>
 139    public int ColliderBId => Event.ColliderBId;
 40
 41    /// <summary>Gets the first endpoint collider's dimension.</summary>
 142    public GravitasColliderDimension ColliderADimension => Event.ColliderADimension;
 43
 44    /// <summary>Gets the second endpoint collider's dimension.</summary>
 145    public GravitasColliderDimension ColliderBDimension => Event.ColliderBDimension;
 46
 47    /// <summary>Gets the first endpoint's 3D collider type.</summary>
 148    public ColliderType ColliderAType => Event.ColliderAType;
 49
 50    /// <summary>Gets the second endpoint's 3D collider type.</summary>
 151    public ColliderType ColliderBType => Event.ColliderBType;
 52
 53    /// <summary>Gets the first endpoint's 2D collider type.</summary>
 154    public ColliderType2D ColliderA2DType => Event.ColliderA2DType;
 55
 56    /// <summary>Gets the second endpoint's 2D collider type.</summary>
 157    public ColliderType2D ColliderB2DType => Event.ColliderB2DType;
 58
 59    /// <summary>Gets the accumulated impulse magnitude for an impulse event.</summary>
 160    public Fixed64 ImpulseMagnitude => Event.ScalarA;
 61
 62    /// <summary>Gets the limit error reported by an impulse or limit event.</summary>
 263    public Fixed64 LimitError => Kind == GravitasDiagnosticEventKind.JointLimitReached
 264        ? Event.ScalarB
 265        : LimitErrorMagnitude;
 66
 67    /// <summary>Gets the linear anchor-error magnitude for an impulse event.</summary>
 168    public Fixed64 LinearAnchorErrorMagnitude => Event.ScalarB;
 69
 70    /// <summary>Gets the motor impulse magnitude for an impulse event.</summary>
 9771    public Fixed64 MotorImpulseMagnitude => Event.Vector.X;
 72
 73    /// <summary>Gets the motor error magnitude for an impulse event.</summary>
 9774    public Fixed64 MotorErrorMagnitude => Event.Vector.Y;
 75
 76    /// <summary>Gets the limit-error magnitude stored by an impulse event.</summary>
 277    public Fixed64 LimitErrorMagnitude => Event.Vector.Z;
 78
 79    /// <summary>Gets the prepared solver-row count for an impulse event.</summary>
 180    public int RowCount => Event.DataA;
 81
 82    /// <summary>Gets the clamped solver-row count for an impulse event.</summary>
 9783    public int ClampedRowCount => Event.DataB;
 84}