diff options
Diffstat (limited to 'servers/physics')
-rw-r--r-- | servers/physics/space_sw.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp index ca3eea364a..68d6b464ab 100644 --- a/servers/physics/space_sw.cpp +++ b/servers/physics/space_sw.cpp @@ -123,6 +123,8 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3& p_from, const Vecto r_result.collider_id=res_obj->get_instance_id();
if (r_result.collider_id!=0)
r_result.collider=ObjectDB::get_instance(r_result.collider_id);
+ else
+ r_result.collider=NULL;
r_result.normal=res_normal;
r_result.position=res_point;
r_result.rid=res_obj->get_self();
@@ -173,6 +175,8 @@ int PhysicsDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Transfo r_results[cc].collider_id=col_obj->get_instance_id();
if (r_results[cc].collider_id!=0)
r_results[cc].collider=ObjectDB::get_instance(r_results[cc].collider_id);
+ else
+ r_results[cc].collider=NULL;
r_results[cc].rid=col_obj->get_self();
r_results[cc].shape=shape_idx;
|