From 91257c39000517dd5644caf0e02a7bc6cd4574a9 Mon Sep 17 00:00:00 2001 From: qarmin Date: Tue, 14 Sep 2021 11:01:49 +0200 Subject: Initialize variables in servers/physics --- servers/physics_2d/collision_object_2d_sw.h | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'servers/physics_2d/collision_object_2d_sw.h') diff --git a/servers/physics_2d/collision_object_2d_sw.h b/servers/physics_2d/collision_object_2d_sw.h index 55ffa9b1b8..69487631a6 100644 --- a/servers/physics_2d/collision_object_2d_sw.h +++ b/servers/physics_2d/collision_object_2d_sw.h @@ -50,32 +50,27 @@ private: RID self; ObjectID instance_id; ObjectID canvas_instance_id; - bool pickable; + bool pickable = true; struct Shape { Transform2D xform; Transform2D xform_inv; - BroadPhase2DSW::ID bpid; + BroadPhase2DSW::ID bpid = 0; Rect2 aabb_cache; //for rayqueries - Shape2DSW *shape; + Shape2DSW *shape = nullptr; Variant metadata; - bool disabled; - bool one_way_collision; - real_t one_way_collision_margin; - Shape() { - disabled = false; - one_way_collision = false; - one_way_collision_margin = 0; - } + bool disabled = false; + bool one_way_collision = false; + real_t one_way_collision_margin = 0.0; }; Vector shapes; - Space2DSW *space; + Space2DSW *space = nullptr; Transform2D transform; Transform2D inv_transform; - uint32_t collision_mask; - uint32_t collision_layer; - bool _static; + uint32_t collision_mask = 1; + uint32_t collision_layer = 1; + bool _static = true; SelfList pending_shape_update_list; -- cgit v1.2.3