| | | 1 | | //======================================================================= |
| | | 2 | | // GravitasCircleQueryDiagnosticView.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 3D X/Z circle-query diagnostic event. |
| | | 15 | | /// </summary> |
| | | 16 | | public readonly struct GravitasCircleQueryDiagnosticView |
| | | 17 | | { |
| | 3 | 18 | | internal GravitasCircleQueryDiagnosticView(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 query 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 nearest hit collider identifier, or <c>-1</c> when none was hit.</summary> |
| | 1 | 30 | | public int HitColliderId => Event.ColliderAId; |
| | | 31 | | |
| | | 32 | | /// <summary>Gets the nearest hit collider type.</summary> |
| | 1 | 33 | | public ColliderType HitColliderType => Event.ColliderAType; |
| | | 34 | | |
| | | 35 | | /// <summary>Gets the X/Z query-circle center.</summary> |
| | 1 | 36 | | public Vector3d Center => Event.Start; |
| | | 37 | | |
| | | 38 | | /// <summary>Gets the endpoint of the directional-filter visualization.</summary> |
| | 1 | 39 | | public Vector3d End => Event.End; |
| | | 40 | | |
| | | 41 | | /// <summary>Gets the materialized nearest hit point, or zero when unavailable.</summary> |
| | 1 | 42 | | public Vector3d HitPoint => Event.PointA; |
| | | 43 | | |
| | | 44 | | /// <summary>Gets the normalized directional filter, or zero for an undirected query.</summary> |
| | 1 | 45 | | public Vector3d Direction => Event.Vector; |
| | | 46 | | |
| | | 47 | | /// <summary>Gets the query-circle radius.</summary> |
| | 1 | 48 | | public Fixed64 Radius => Event.ScalarA; |
| | | 49 | | |
| | | 50 | | /// <summary>Gets the nearest hit separation distance.</summary> |
| | 1 | 51 | | public Fixed64 Distance => Event.ScalarB; |
| | | 52 | | |
| | | 53 | | /// <summary>Gets the query layer-mask bits.</summary> |
| | 1 | 54 | | public int LayerMaskBits => Event.DataA; |
| | | 55 | | |
| | | 56 | | /// <summary>Gets the number of hits reported by the query.</summary> |
| | 1 | 57 | | public int HitCount => Event.DataB; |
| | | 58 | | |
| | | 59 | | /// <summary>Gets whether the query found an overlap.</summary> |
| | 1 | 60 | | public bool Hit => Event.Hit; |
| | | 61 | | } |