Merge pull request #43742 from qarmin/editor_modules_default_values

Initialize class/struct variables with default values in platform/ and editor/
This commit is contained in:
Rémi Verschelde 2020-12-08 15:53:42 +01:00 committed by GitHub
commit 90bdba576a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
87 changed files with 411 additions and 540 deletions

View file

@ -61,16 +61,10 @@ public:
Ref<Material> material;
Ref<SkinReference> skin_reference;
RID skeleton;
bool billboard;
bool unscaled;
bool can_intersect;
bool extra_margin;
Instance() {
billboard = false;
unscaled = false;
can_intersect = false;
extra_margin = false;
}
bool billboard = false;
bool unscaled = false;
bool can_intersect = false;
bool extra_margin = false;
void create_instance(Node3D *p_base, bool p_hidden = false);
};
@ -80,7 +74,7 @@ public:
struct Handle {
Vector3 pos;
bool billboard;
bool billboard = false;
};
Vector<Vector3> handles;
@ -297,9 +291,9 @@ private:
Label *fps_label;
struct _RayResult {
Node3D *item;
float depth;
int handle;
Node3D *item = nullptr;
float depth = 0;
int handle = 0;
_FORCE_INLINE_ bool operator<(const _RayResult &p_rr) const { return depth < p_rr.depth; }
};
@ -376,11 +370,11 @@ private:
Vector3 click_ray_pos;
Vector3 center;
Vector3 orig_gizmo_pos;
int edited_gizmo;
int edited_gizmo = 0;
Point2 mouse_pos;
bool snap;
bool snap = false;
Ref<EditorNode3DGizmo> gizmo;
int gizmo_handle;
int gizmo_handle = 0;
Variant gizmo_initial_value;
Vector3 gizmo_initial_pos;
} _edit;
@ -626,8 +620,8 @@ private:
AABB preview_bounds;
struct Gizmo {
bool visible;
float scale;
bool visible = false;
float scale = 0;
Transform transform;
} gizmo;