You've already forked godot
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user