| | | 1 | | //======================================================================= |
| | | 2 | | // PlanarProjectionRelation.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 | | namespace FixedMathSharp.Geometry; |
| | | 9 | | |
| | | 10 | | /// <summary> |
| | | 11 | | /// Retains the representable distance and offset from a planar query point to |
| | | 12 | | /// an exact projected solid. |
| | | 13 | | /// </summary> |
| | | 14 | | internal readonly struct PlanarProjectionRelation |
| | | 15 | | { |
| | 1 | 16 | | internal static readonly PlanarProjectionRelation Contained = |
| | 1 | 17 | | new( |
| | 1 | 18 | | Fixed64.Zero, |
| | 1 | 19 | | Vector2d.Zero, |
| | 1 | 20 | | Vector2d.Zero, |
| | 1 | 21 | | isContained: true); |
| | | 22 | | |
| | | 23 | | internal PlanarProjectionRelation( |
| | | 24 | | Fixed64 distance, |
| | | 25 | | Vector2d offset, |
| | | 26 | | Vector2d direction) |
| | 30 | 27 | | : this(distance, offset, direction, isContained: false) |
| | | 28 | | { |
| | 30 | 29 | | } |
| | | 30 | | |
| | | 31 | | private PlanarProjectionRelation( |
| | | 32 | | Fixed64 distance, |
| | | 33 | | Vector2d offset, |
| | | 34 | | Vector2d direction, |
| | | 35 | | bool isContained) |
| | | 36 | | { |
| | 31 | 37 | | Distance = distance; |
| | 31 | 38 | | Offset = offset; |
| | 31 | 39 | | Direction = direction; |
| | 31 | 40 | | IsContained = isContained; |
| | 31 | 41 | | } |
| | | 42 | | |
| | | 43 | | internal Fixed64 Distance { get; } |
| | | 44 | | |
| | | 45 | | internal Vector2d Offset { get; } |
| | | 46 | | |
| | | 47 | | internal Vector2d Direction { get; } |
| | | 48 | | |
| | | 49 | | internal bool IsContained { get; } |
| | | 50 | | } |