Add motion parameter to toggle whether recovery is reported as a collision

This makes the intent explicit in each use case.
This commit is contained in:
Ricardo Buring 2022-04-28 22:44:09 +02:00
parent cdc5da7460
commit f072aa69a9
10 changed files with 45 additions and 26 deletions

View file

@ -874,7 +874,7 @@ bool GodotSpace2D::test_body_motion(GodotBody2D *p_body, const PhysicsServer2D::
bool collided = false;
if (recovered || (safe < 1)) {
if ((p_parameters.recovery_as_collision && recovered) || (safe < 1)) {
if (safe >= 1) {
best_shape = -1; //no best shape with cast, reset to -1
}