summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-06-07 20:40:19 +0200
committerGitHub <noreply@github.com>2021-06-07 20:40:19 +0200
commitbf7dedb9e2c0bad0c9d8f61b7c0de65d016baccd (patch)
tree3d4d7ebfe2a805a5cd6bf2f9f4d968e638df79a6
parent6e9a4c268fac7b20dda29841e7c37a236a2c4ffa (diff)
parent19dee4702af933474e72e52ce7851b6f5b58942d (diff)
Merge pull request #49397 from nekomatata/query-uninitialized-members
Fix uninitialized members in physics query results
-rw-r--r--servers/physics_server_2d.h10
-rw-r--r--servers/physics_server_3d.h10
2 files changed, 10 insertions, 10 deletions
diff --git a/servers/physics_server_2d.h b/servers/physics_server_2d.h
index ff6d179f5b..35430e4a46 100644
--- a/servers/physics_server_2d.h
+++ b/servers/physics_server_2d.h
@@ -164,8 +164,8 @@ public:
Vector2 normal;
RID rid;
ObjectID collider_id;
- Object *collider;
- int shape;
+ Object *collider = nullptr;
+ int shape = 0;
Variant metadata;
};
@@ -174,8 +174,8 @@ public:
struct ShapeResult {
RID rid;
ObjectID collider_id;
- Object *collider;
- int shape;
+ Object *collider = nullptr;
+ int shape = 0;
Variant metadata;
};
@@ -193,7 +193,7 @@ public:
Vector2 normal;
RID rid;
ObjectID collider_id;
- int shape;
+ int shape = 0;
Vector2 linear_velocity; //velocity at contact point
Variant metadata;
};
diff --git a/servers/physics_server_3d.h b/servers/physics_server_3d.h
index 4e76f7ce7e..ec4914641a 100644
--- a/servers/physics_server_3d.h
+++ b/servers/physics_server_3d.h
@@ -157,8 +157,8 @@ public:
struct ShapeResult {
RID rid;
ObjectID collider_id;
- Object *collider;
- int shape;
+ Object *collider = nullptr;
+ int shape = 0;
};
virtual int intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false) = 0;
@@ -168,8 +168,8 @@ public:
Vector3 normal;
RID rid;
ObjectID collider_id;
- Object *collider;
- int shape;
+ Object *collider = nullptr;
+ int shape = 0;
};
virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false, bool p_pick_ray = false) = 0;
@@ -181,7 +181,7 @@ public:
Vector3 normal;
RID rid;
ObjectID collider_id;
- int shape;
+ int shape = 0;
Vector3 linear_velocity; //velocity at contact point
};