| | | 1 | | //======================================================================= |
| | | 2 | | // FixedContactAnchors.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 | | /// Describes one 3D contact relation using points retained in their rigid |
| | | 12 | | /// local frames. |
| | | 13 | | /// </summary> |
| | | 14 | | public readonly struct FixedContactAnchors |
| | | 15 | | { |
| | | 16 | | internal FixedContactAnchors( |
| | | 17 | | FixedPointAnchor firstAnchor, |
| | | 18 | | FixedPointAnchor secondAnchor, |
| | | 19 | | Vector3d normal, |
| | | 20 | | Fixed64 depth, |
| | | 21 | | bool depthIsClamped) |
| | | 22 | | { |
| | 2485 | 23 | | FirstAnchor = firstAnchor; |
| | 2485 | 24 | | SecondAnchor = secondAnchor; |
| | 2485 | 25 | | Normal = normal; |
| | 2485 | 26 | | Depth = depth; |
| | 2485 | 27 | | DepthIsClamped = depthIsClamped; |
| | 2485 | 28 | | } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// The contact point retained in the first shape's rigid frame. |
| | | 32 | | /// </summary> |
| | | 33 | | public FixedPointAnchor FirstAnchor { get; } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// The contact point retained in the second shape's rigid frame. |
| | | 37 | | /// </summary> |
| | | 38 | | public FixedPointAnchor SecondAnchor { get; } |
| | | 39 | | |
| | | 40 | | /// <summary> |
| | | 41 | | /// The contact normal directed from the first shape toward the second. |
| | | 42 | | /// </summary> |
| | | 43 | | public Vector3d Normal { get; } |
| | | 44 | | |
| | | 45 | | /// <summary> |
| | | 46 | | /// The representable penetration depth. |
| | | 47 | | /// </summary> |
| | | 48 | | public Fixed64 Depth { get; } |
| | | 49 | | |
| | | 50 | | /// <summary> |
| | | 51 | | /// Whether the conceptual penetration exceeds <see cref="Fixed64.MaxValue"/>. |
| | | 52 | | /// </summary> |
| | | 53 | | public bool DepthIsClamped { get; } |
| | | 54 | | } |