| | | 1 | | //======================================================================= |
| | | 2 | | // JointConstraintRow2D.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.Constraints; |
| | | 11 | | |
| | | 12 | | internal enum JointConstraintRowKind2D : byte |
| | | 13 | | { |
| | | 14 | | Linear, |
| | | 15 | | Angular, |
| | | 16 | | Motor |
| | | 17 | | } |
| | | 18 | | |
| | | 19 | | internal struct JointConstraintRow2D |
| | | 20 | | { |
| | | 21 | | public JointConstraintRow2D( |
| | | 22 | | JointConstraintRowKind2D kind, |
| | | 23 | | Vector2d axis, |
| | | 24 | | Vector2d relativeAnchorA, |
| | | 25 | | Vector2d relativeAnchorB, |
| | | 26 | | Fixed64 biasVelocity, |
| | | 27 | | Fixed64 damping, |
| | | 28 | | Fixed64 lowerImpulse, |
| | | 29 | | Fixed64 upperImpulse, |
| | | 30 | | int cacheIndex) |
| | | 31 | | { |
| | 3284 | 32 | | Kind = kind; |
| | 3284 | 33 | | Axis = axis; |
| | 3284 | 34 | | RelativeAnchorA = relativeAnchorA; |
| | 3284 | 35 | | RelativeAnchorB = relativeAnchorB; |
| | 3284 | 36 | | BiasVelocity = biasVelocity; |
| | 3284 | 37 | | Damping = damping; |
| | 3284 | 38 | | LowerImpulse = lowerImpulse; |
| | 3284 | 39 | | UpperImpulse = upperImpulse; |
| | 3284 | 40 | | CacheIndex = cacheIndex; |
| | 3284 | 41 | | AccumulatedImpulse = Fixed64.Zero; |
| | 3284 | 42 | | } |
| | | 43 | | |
| | | 44 | | public JointConstraintRowKind2D Kind; |
| | | 45 | | public Vector2d Axis; |
| | | 46 | | public Vector2d RelativeAnchorA; |
| | | 47 | | public Vector2d RelativeAnchorB; |
| | | 48 | | public Fixed64 BiasVelocity; |
| | | 49 | | public Fixed64 Damping; |
| | | 50 | | public Fixed64 LowerImpulse; |
| | | 51 | | public Fixed64 UpperImpulse; |
| | | 52 | | public int CacheIndex; |
| | | 53 | | public Fixed64 AccumulatedImpulse; |
| | | 54 | | } |