1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-07 17:36:07 +00:00

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

@@ -265,11 +265,11 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transform
continue;
}
//test initial overlap
//test initial overlap, ignore objects it's inside of.
sep_axis = p_motion.normalized();
if (!CollisionSolverSW::solve_distance(shape, p_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, aabb, &sep_axis)) {
return false;
continue;
}
//just do kinematic solving