< Summary

Information
Class: Gravitas.Diagnostics.GravitasRayQueryDiagnosticView
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/Diagnostics/Events/Queries/GravitasRayQueryDiagnosticView.cs
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 61
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_HitColliderId()100%11100%
get_HitColliderType()100%11100%
get_Start()100%11100%
get_End()100%11100%
get_HitPoint()100%11100%
get_Normal()100%11100%
get_SweepRadius()100%11100%
get_Distance()100%11100%
get_LayerMaskBits()100%11100%
get_HitCount()100%11100%
get_Hit()100%11100%

File(s)

/home/runner/work/Gravitas/Gravitas/src/Gravitas/Diagnostics/Events/Queries/GravitasRayQueryDiagnosticView.cs

#LineLine coverage
 1//=======================================================================
 2// GravitasRayQueryDiagnosticView.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 3D ray or swept-sphere query diagnostic event.
 15/// </summary>
 16public readonly struct GravitasRayQueryDiagnosticView
 17{
 318    internal GravitasRayQueryDiagnosticView(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>
 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 hit collider identifier, or <c>-1</c> when no collider was hit.</summary>
 130    public int HitColliderId => Event.ColliderAId;
 31
 32    /// <summary>Gets the hit collider type.</summary>
 133    public ColliderType HitColliderType => Event.ColliderAType;
 34
 35    /// <summary>Gets the query start point.</summary>
 136    public Vector3d Start => Event.Start;
 37
 38    /// <summary>Gets the query endpoint.</summary>
 139    public Vector3d End => Event.End;
 40
 41    /// <summary>Gets the materialized hit point, or zero when unavailable.</summary>
 142    public Vector3d HitPoint => Event.PointA;
 43
 44    /// <summary>Gets the hit normal.</summary>
 145    public Vector3d Normal => Event.Vector;
 46
 47    /// <summary>Gets the sweep radius, or zero for a raycast.</summary>
 148    public Fixed64 SweepRadius => Event.ScalarA;
 49
 50    /// <summary>Gets the distance to the nearest hit.</summary>
 151    public Fixed64 Distance => Event.ScalarB;
 52
 53    /// <summary>Gets the query layer-mask bits.</summary>
 154    public int LayerMaskBits => Event.DataA;
 55
 56    /// <summary>Gets the number of hits reported by the query.</summary>
 157    public int HitCount => Event.DataB;
 58
 59    /// <summary>Gets whether the query hit a collider.</summary>
 160    public bool Hit => Event.Hit;
 61}