You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +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:
@@ -295,7 +295,7 @@ Array PhysicsDirectSpaceState3D::_intersect_shape(const Ref<PhysicsShapeQueryPar
|
||||
Array PhysicsDirectSpaceState3D::_cast_motion(const Ref<PhysicsShapeQueryParameters3D> &p_shape_query, const Vector3 &p_motion) {
|
||||
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