| | | 1 | | //======================================================================= |
| | | 2 | | // ExactNormalConstraint3D.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 | | |
| | | 10 | | namespace Gravitas.CollisionHandling; |
| | | 11 | | |
| | | 12 | | /// <summary> |
| | | 13 | | /// Describes the normal constraint that supplies a Coulomb response. |
| | | 14 | | /// </summary> |
| | | 15 | | internal readonly struct ExactNormalConstraint3D |
| | | 16 | | { |
| | | 17 | | internal ExactNormalConstraint3D( |
| | | 18 | | in ExactContactResponseOperand3D first, |
| | | 19 | | in ExactContactResponseOperand3D second, |
| | | 20 | | Vector3d normal, |
| | | 21 | | Fixed64 restitution, |
| | | 22 | | Fixed64 restitutionVelocityThreshold, |
| | | 23 | | Fixed64 accumulatedImpulse, |
| | | 24 | | Fixed64 positiveImpulseScale, |
| | | 25 | | Fixed64 negativeImpulseScale) |
| | | 26 | | { |
| | 87 | 27 | | First = first; |
| | 87 | 28 | | Second = second; |
| | 87 | 29 | | Normal = normal; |
| | 87 | 30 | | Restitution = restitution; |
| | 87 | 31 | | RestitutionVelocityThreshold = restitutionVelocityThreshold; |
| | 87 | 32 | | AccumulatedImpulse = accumulatedImpulse; |
| | 87 | 33 | | PositiveImpulseScale = positiveImpulseScale; |
| | 87 | 34 | | NegativeImpulseScale = negativeImpulseScale; |
| | 87 | 35 | | } |
| | | 36 | | |
| | | 37 | | internal ExactContactResponseOperand3D First { get; } |
| | | 38 | | |
| | | 39 | | internal ExactContactResponseOperand3D Second { get; } |
| | | 40 | | |
| | | 41 | | internal Vector3d Normal { get; } |
| | | 42 | | |
| | | 43 | | internal Fixed64 Restitution { get; } |
| | | 44 | | |
| | | 45 | | internal Fixed64 RestitutionVelocityThreshold { get; } |
| | | 46 | | |
| | | 47 | | internal Fixed64 AccumulatedImpulse { get; } |
| | | 48 | | |
| | | 49 | | internal Fixed64 PositiveImpulseScale { get; } |
| | | 50 | | |
| | | 51 | | internal Fixed64 NegativeImpulseScale { get; } |
| | | 52 | | } |