You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +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:
@@ -177,8 +177,10 @@ bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transf
|
||||
bt_xform_to.getOrigin() += bt_motion;
|
||||
|
||||
if ((bt_xform_to.getOrigin() - bt_xform_from.getOrigin()).fuzzyZero()) {
|
||||
r_closest_safe = 1.0f;
|
||||
r_closest_unsafe = 1.0f;
|
||||
bulletdelete(btShape);
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
GodotClosestConvexResultCallback btResult(bt_xform_from.getOrigin(), bt_xform_to.getOrigin(), &p_exclude, p_collide_with_bodies, p_collide_with_areas);
|
||||
|
||||
Reference in New Issue
Block a user