| | | 1 | | //======================================================================= |
| | | 2 | | // GravitasRagdollDiagnosticView.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 | | |
| | | 8 | | namespace Gravitas.Diagnostics; |
| | | 9 | | |
| | | 10 | | /// <summary> |
| | | 11 | | /// Typed read-only view over a ragdoll active-state diagnostic event. |
| | | 12 | | /// </summary> |
| | | 13 | | public readonly struct GravitasRagdollDiagnosticView |
| | | 14 | | { |
| | 3 | 15 | | internal GravitasRagdollDiagnosticView(GravitasDiagnosticEvent diagnosticEvent) => Event = diagnosticEvent; |
| | | 16 | | |
| | | 17 | | /// <summary>Gets the underlying diagnostic event.</summary> |
| | | 18 | | public GravitasDiagnosticEvent Event { get; } |
| | | 19 | | |
| | | 20 | | /// <summary>Gets the simulation frame in which the state change was captured.</summary> |
| | 1 | 21 | | public long Frame => Event.Frame; |
| | | 22 | | |
| | | 23 | | /// <summary>Gets the event's sequence within its capture buffer.</summary> |
| | 1 | 24 | | public int Sequence => Event.Sequence; |
| | | 25 | | |
| | | 26 | | /// <summary>Gets the context-local ragdoll identifier.</summary> |
| | 2 | 27 | | public int RagdollId => Event.BodyId; |
| | | 28 | | |
| | | 29 | | /// <summary>Gets the number of ragdoll links.</summary> |
| | 1 | 30 | | public int LinkCount => Event.DataA; |
| | | 31 | | |
| | | 32 | | /// <summary>Gets the number of ragdoll joints.</summary> |
| | 1 | 33 | | public int JointCount => Event.DataB; |
| | | 34 | | |
| | | 35 | | /// <summary>Gets whether the ragdoll is active.</summary> |
| | 1 | 36 | | public bool IsActive => Event.Hit; |
| | | 37 | | } |