1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Check for motion in cast_motion() before doing Bullet convexSweepTest().

Also ensure that default closest_safe and closest_unsafe values are
defined in cast_motion() and before cast_motion() is called.
This commit is contained in:
Marcel Admiraal
2019-12-09 11:11:06 +01:00
parent bd16fd9d19
commit b006f5402d
3 changed files with 17 additions and 10 deletions

View File

@@ -309,7 +309,7 @@ Array PhysicsDirectSpaceState::_cast_motion(const Ref<PhysicsShapeQueryParameter
ERR_FAIL_COND_V(!p_shape_query.is_valid(), Array());
float closest_safe, closest_unsafe;
float closest_safe = 1.0f, closest_unsafe = 1.0f;
bool res = cast_motion(p_shape_query->shape, p_shape_query->transform, p_motion, p_shape_query->margin, closest_safe, closest_unsafe, p_shape_query->exclude, p_shape_query->collision_mask, p_shape_query->collide_with_bodies, p_shape_query->collide_with_areas);
if (!res)
return Array();