summaryrefslogtreecommitdiff
path: root/servers/physics_2d/collision_object_2d_sw.h
diff options
context:
space:
mode:
authorqarmin <mikrutrafal@protonmail.com>2021-09-14 11:01:49 +0200
committerRafaƂ Mikrut <mikrutrafal@protonmail.com>2021-09-15 19:41:32 +0200
commit91257c39000517dd5644caf0e02a7bc6cd4574a9 (patch)
treebda41f7f6f95f48a9e8a4f1df794e48c767eded3 /servers/physics_2d/collision_object_2d_sw.h
parent7b21b1bb608909b373237d19467c6236537b8062 (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.h25
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;