diff options
author | qarmin <mikrutrafal@protonmail.com> | 2021-09-14 11:01:49 +0200 |
---|---|---|
committer | RafaĆ Mikrut <mikrutrafal@protonmail.com> | 2021-09-15 19:41:32 +0200 |
commit | 91257c39000517dd5644caf0e02a7bc6cd4574a9 (patch) | |
tree | bda41f7f6f95f48a9e8a4f1df794e48c767eded3 /servers/physics_2d/collision_object_2d_sw.h | |
parent | 7b21b1bb608909b373237d19467c6236537b8062 (diff) |
Initialize variables in servers/physics
Diffstat (limited to 'servers/physics_2d/collision_object_2d_sw.h')
-rw-r--r-- | servers/physics_2d/collision_object_2d_sw.h | 25 |
1 files changed, 10 insertions, 15 deletions
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<Shape> 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<CollisionObject2DSW> pending_shape_update_list; |