| | | 1 | | //======================================================================= |
| | | 2 | | // ContinuousCollisionTargetPolicy.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 | | namespace Gravitas.CollisionHandling; |
| | | 9 | | |
| | | 10 | | internal static class ContinuousCollisionTargetPolicy |
| | | 11 | | { |
| | | 12 | | internal static bool AllowsIndexed3DTarget( |
| | | 13 | | bool isSelf, |
| | | 14 | | bool active, |
| | | 15 | | bool dynamicBody, |
| | | 16 | | bool kinematic, |
| | | 17 | | bool movingKinematic, |
| | | 18 | | bool trigger, |
| | | 19 | | bool physicalPairRequired) => |
| | 6746 | 20 | | !isSelf |
| | 6746 | 21 | | && active |
| | 6746 | 22 | | && (kinematic ? movingKinematic : dynamicBody) |
| | 6746 | 23 | | && !trigger |
| | 6746 | 24 | | && physicalPairRequired; |
| | | 25 | | |
| | | 26 | | internal static bool AllowsIndexed2DTarget( |
| | | 27 | | bool isSelf, |
| | | 28 | | bool active, |
| | | 29 | | bool dynamicBody, |
| | | 30 | | bool kinematic, |
| | | 31 | | bool movingKinematic, |
| | | 32 | | bool trigger, |
| | | 33 | | bool physicalPairRequired) => |
| | 452 | 34 | | !isSelf |
| | 452 | 35 | | && active |
| | 452 | 36 | | && (kinematic ? movingKinematic : dynamicBody) |
| | 452 | 37 | | && !trigger |
| | 452 | 38 | | && physicalPairRequired; |
| | | 39 | | |
| | | 40 | | internal static bool AllowsMixedIndexedTarget( |
| | | 41 | | bool active, |
| | | 42 | | bool dynamicBody, |
| | | 43 | | bool kinematic, |
| | | 44 | | bool movingKinematic, |
| | | 45 | | bool trigger, |
| | | 46 | | bool mixedPairRequired) => |
| | 92 | 47 | | active |
| | 92 | 48 | | && (kinematic ? movingKinematic : dynamicBody) |
| | 92 | 49 | | && !trigger |
| | 92 | 50 | | && mixedPairRequired; |
| | | 51 | | |
| | | 52 | | internal static bool AllowsStaticOrKinematic3DTarget( |
| | | 53 | | bool isSelf, |
| | | 54 | | bool ignored, |
| | | 55 | | bool trigger, |
| | | 56 | | bool physicalPairRequired, |
| | | 57 | | bool isStatic, |
| | | 58 | | bool bodyKinematic) => |
| | 6395 | 59 | | !isSelf |
| | 6395 | 60 | | && !ignored |
| | 6395 | 61 | | && !trigger |
| | 6395 | 62 | | && physicalPairRequired |
| | 6395 | 63 | | && (isStatic || bodyKinematic); |
| | | 64 | | |
| | | 65 | | internal static bool AllowsStaticOrKinematic2DTarget( |
| | | 66 | | bool isSelf, |
| | | 67 | | bool ignored, |
| | | 68 | | bool trigger, |
| | | 69 | | bool physicalPairRequired, |
| | | 70 | | bool isStatic, |
| | | 71 | | bool bodyKinematic) => |
| | 284 | 72 | | !isSelf |
| | 284 | 73 | | && !ignored |
| | 284 | 74 | | && !trigger |
| | 284 | 75 | | && physicalPairRequired |
| | 284 | 76 | | && (isStatic || bodyKinematic); |
| | | 77 | | |
| | | 78 | | internal static bool AllowsMixedStaticOrKinematicTarget( |
| | | 79 | | bool ignored, |
| | | 80 | | bool trigger, |
| | | 81 | | bool mixedPairRequired, |
| | | 82 | | bool isStatic, |
| | | 83 | | bool bodyKinematic) => |
| | 14 | 84 | | !ignored |
| | 14 | 85 | | && !trigger |
| | 14 | 86 | | && mixedPairRequired |
| | 14 | 87 | | && (isStatic || bodyKinematic); |
| | | 88 | | } |