| | | 1 | | //======================================================================= |
| | | 2 | | // ConePlaneRayEvent.cs |
| | | 3 | | //======================================================================= |
| | | 4 | | // MIT License, Copyright (c) 2024-present David Oravsky (mrdav30) |
| | | 5 | | // See LICENSE file in the project root for full license information. |
| | | 6 | | //======================================================================= |
| | | 7 | | |
| | | 8 | | using System; |
| | | 9 | | |
| | | 10 | | namespace FixedMathSharp.Geometry; |
| | | 11 | | |
| | | 12 | | /// <summary>A reconstructible finite feature in its shared plane or finite segment.</summary> |
| | | 13 | | internal readonly struct ConePlaneRayEvent |
| | | 14 | | { |
| | | 15 | | internal readonly ConePlaneRayEventKind Kind; |
| | | 16 | | internal readonly byte Feature, Quadrant; |
| | | 17 | | internal readonly sbyte Branch, Endpoint, Orientation; |
| | | 18 | | |
| | | 19 | | internal ConePlaneRayEvent(ConePlaneRayEventKind kind, int feature = 0, int quadrant = 0, |
| | | 20 | | int branch = 0, int endpoint = -1, int orientation = 0) |
| | | 21 | | { |
| | 310236 | 22 | | Kind = kind; Feature = (byte)feature; Quadrant = (byte)quadrant; |
| | 310236 | 23 | | Branch = (sbyte)branch; Endpoint = (sbyte)endpoint; Orientation = (sbyte)orientation; |
| | 103412 | 24 | | } |
| | | 25 | | |
| | 42605 | 26 | | internal bool Matches(in ConePlaneRayEvent other) => Kind == other.Kind && Feature == other.Feature |
| | 42605 | 27 | | && Quadrant == other.Quadrant && Branch == other.Branch && Endpoint == other.Endpoint; |
| | | 28 | | |
| | | 29 | | |
| | | 30 | | } |