| | | 1 | | //======================================================================= |
| | | 2 | | // GravitasTorqueDeltaDiagnosticView.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 | | using FixedMathSharp; |
| | | 9 | | using Gravitas.Colliders; |
| | | 10 | | |
| | | 11 | | namespace Gravitas.Diagnostics; |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// Typed read-only view over a torque-delta diagnostic event. |
| | | 15 | | /// </summary> |
| | | 16 | | public readonly struct GravitasTorqueDeltaDiagnosticView |
| | | 17 | | { |
| | 4 | 18 | | internal GravitasTorqueDeltaDiagnosticView(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 torque was captured.</summary> |
| | 1 | 24 | | public long Frame => Event.Frame; |
| | | 25 | | |
| | | 26 | | /// <summary>Gets the event's sequence within its capture buffer.</summary> |
| | 1 | 27 | | public int Sequence => Event.Sequence; |
| | | 28 | | |
| | | 29 | | /// <summary>Gets the context-local body identifier.</summary> |
| | 1 | 30 | | public int BodyId => Event.BodyId; |
| | | 31 | | |
| | | 32 | | /// <summary>Gets the body's context-local collider identifier.</summary> |
| | 1 | 33 | | public int ColliderId => Event.ColliderAId; |
| | | 34 | | |
| | | 35 | | /// <summary>Gets the body's collider type.</summary> |
| | 1 | 36 | | public ColliderType ColliderType => Event.ColliderAType; |
| | | 37 | | |
| | | 38 | | /// <summary>Gets the applied torque.</summary> |
| | 1 | 39 | | public Vector3d Torque => Event.Vector; |
| | | 40 | | |
| | | 41 | | /// <summary>Gets the magnitude of the applied torque.</summary> |
| | 1 | 42 | | public Fixed64 TorqueMagnitude => Event.ScalarA; |
| | | 43 | | } |