Fix cast_motion sometimes failing

- Fixes Godot physics failing when the cast Shape is inside of, or
already colliding with another Shape.
- Fixes Bullet physics failing when there is no motion.
- Ensures Godot and Bullet physics behave the same.
- Updates the documentation to exclude the caveats for the failures and
differences.
This commit is contained in:
Marcel Admiraal
2020-11-27 14:35:10 +00:00
parent 803f6d2388
commit 2e99b5b137
5 changed files with 13 additions and 9 deletions

View File

@ -269,10 +269,10 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transfor
continue;
}
//test initial overlap
//test initial overlap, ignore objects it's inside of.
if (CollisionSolver2DSW::solve(shape, p_xform, Vector2(), col_obj->get_shape(shape_idx), col_obj_xform, Vector2(), NULL, NULL, NULL, p_margin)) {
return false;
continue;
}
//just do kinematic solving