< Summary

Information
Class: Gravitas.CollisionHandling.ContinuousCollisionTargetPolicy
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/CollisionHandling/Continuous/Candidates/ContinuousCollisionTargetPolicy.cs
Line coverage
100%
Covered lines: 28
Uncovered lines: 0
Coverable lines: 28
Total lines: 91
Line coverage: 100%
Branch coverage
100%
Covered branches: 34
Total branches: 34
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
AllowsIndexed3DTarget(...)100%66100%
AllowsIndexed2DTarget(...)100%66100%
AllowsMixedIndexedTarget(...)100%66100%
AllowsStaticOrKinematic3DTarget(...)100%66100%
AllowsStaticOrKinematic2DTarget(...)100%66100%
AllowsMixedStaticOrKinematicTarget(...)100%44100%

File(s)

/home/runner/work/Gravitas/Gravitas/src/Gravitas/CollisionHandling/Continuous/Candidates/ContinuousCollisionTargetPolicy.cs

#LineLine coverage
 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
 8namespace Gravitas.CollisionHandling;
 9
 10/// <summary>
 11/// Defines eligibility for dynamic candidate indexes and static or kinematic CCD targets.
 12/// </summary>
 13internal static class ContinuousCollisionTargetPolicy
 14{
 15    internal static bool AllowsIndexed3DTarget(
 16        bool isSelf,
 17        bool active,
 18        bool dynamicBody,
 19        bool kinematic,
 20        bool movingKinematic,
 21        bool trigger,
 22        bool physicalPairRequired) =>
 784123        !isSelf
 784124        && active
 784125        && (kinematic ? movingKinematic : dynamicBody)
 784126        && !trigger
 784127        && physicalPairRequired;
 28
 29    internal static bool AllowsIndexed2DTarget(
 30        bool isSelf,
 31        bool active,
 32        bool dynamicBody,
 33        bool kinematic,
 34        bool movingKinematic,
 35        bool trigger,
 36        bool physicalPairRequired) =>
 113837        !isSelf
 113838        && active
 113839        && (kinematic ? movingKinematic : dynamicBody)
 113840        && !trigger
 113841        && physicalPairRequired;
 42
 43    internal static bool AllowsMixedIndexedTarget(
 44        bool active,
 45        bool dynamicBody,
 46        bool kinematic,
 47        bool movingKinematic,
 48        bool trigger,
 49        bool mixedPairRequired) =>
 15750        active
 15751        && (kinematic ? movingKinematic : dynamicBody)
 15752        && !trigger
 15753        && mixedPairRequired;
 54
 55    internal static bool AllowsStaticOrKinematic3DTarget(
 56        bool isSelf,
 57        bool ignored,
 58        bool trigger,
 59        bool physicalPairRequired,
 60        bool isStatic,
 61        bool bodyKinematic) =>
 702462        !isSelf
 702463        && !ignored
 702464        && !trigger
 702465        && physicalPairRequired
 702466        && (isStatic || bodyKinematic);
 67
 68    internal static bool AllowsStaticOrKinematic2DTarget(
 69        bool isSelf,
 70        bool ignored,
 71        bool trigger,
 72        bool physicalPairRequired,
 73        bool isStatic,
 74        bool bodyKinematic) =>
 56275        !isSelf
 56276        && !ignored
 56277        && !trigger
 56278        && physicalPairRequired
 56279        && (isStatic || bodyKinematic);
 80
 81    internal static bool AllowsMixedStaticOrKinematicTarget(
 82        bool ignored,
 83        bool trigger,
 84        bool mixedPairRequired,
 85        bool isStatic,
 86        bool bodyKinematic) =>
 37587        !ignored
 37588        && !trigger
 37589        && mixedPairRequired
 37590        && (isStatic || bodyKinematic);
 91}