diff options
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/camera_3d.cpp | 6 | ||||
-rw-r--r-- | scene/3d/node_3d.cpp | 26 | ||||
-rw-r--r-- | scene/3d/node_3d.h | 33 | ||||
-rw-r--r-- | scene/3d/path_3d.cpp | 11 | ||||
-rw-r--r-- | scene/3d/path_3d.h | 18 | ||||
-rw-r--r-- | scene/3d/xr_nodes.cpp | 6 | ||||
-rw-r--r-- | scene/3d/xr_nodes.h | 2 |
7 files changed, 33 insertions, 69 deletions
diff --git a/scene/3d/camera_3d.cpp b/scene/3d/camera_3d.cpp index 191159448a..178c5c8ff8 100644 --- a/scene/3d/camera_3d.cpp +++ b/scene/3d/camera_3d.cpp @@ -519,8 +519,8 @@ void Camera3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fov", PROPERTY_HINT_RANGE, "1,179,0.1"), "set_fov", "get_fov"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "size", PROPERTY_HINT_RANGE, "0.1,16384,0.01"), "set_size", "get_size"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "frustum_offset"), "set_frustum_offset", "get_frustum_offset"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "near", PROPERTY_HINT_EXP_RANGE, "0.001,8192,0.001,or_greater"), "set_znear", "get_znear"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "far", PROPERTY_HINT_EXP_RANGE, "0.01,8192,0.01,or_greater"), "set_zfar", "get_zfar"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "near", PROPERTY_HINT_EXP_RANGE, "0.001,10,0.001,or_greater"), "set_znear", "get_znear"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "far", PROPERTY_HINT_EXP_RANGE, "0.01,4000,0.01,or_greater"), "set_zfar", "get_zfar"); BIND_ENUM_CONSTANT(PROJECTION_PERSPECTIVE); BIND_ENUM_CONSTANT(PROJECTION_ORTHOGONAL); @@ -662,7 +662,7 @@ Camera3D::Camera3D() { viewport = nullptr; force_change = false; mode = PROJECTION_PERSPECTIVE; - set_perspective(75.0, 0.05, 100.0); + set_perspective(75.0, 0.05, 4000.0); keep_aspect = KEEP_HEIGHT; layers = 0xfffff; v_offset = 0; diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp index e8005f38ed..deb04f0978 100644 --- a/scene/3d/node_3d.cpp +++ b/scene/3d/node_3d.cpp @@ -784,28 +784,4 @@ void Node3D::_bind_methods() { } Node3D::Node3D() : - xform_change(this) { - data.dirty = DIRTY_NONE; - data.children_lock = 0; - - data.ignore_notification = false; - data.top_level = false; - data.top_level_active = false; - data.scale = Vector3(1, 1, 1); - data.viewport = nullptr; - data.inside_world = false; - data.visible = true; - data.disable_scale = false; - -#ifdef TOOLS_ENABLED - data.gizmo_disabled = false; - data.gizmo_dirty = false; -#endif - data.notify_local_transform = false; - data.notify_transform = false; - data.parent = nullptr; - data.C = nullptr; -} - -Node3D::~Node3D() { -} + xform_change(this) {} diff --git a/scene/3d/node_3d.h b/scene/3d/node_3d.h index 5fb421c930..180c441a2a 100644 --- a/scene/3d/node_3d.h +++ b/scene/3d/node_3d.h @@ -65,32 +65,32 @@ class Node3D : public Node { mutable Transform global_transform; mutable Transform local_transform; mutable Vector3 rotation; - mutable Vector3 scale; + mutable Vector3 scale = Vector3(1, 1, 1); - mutable int dirty; + mutable int dirty = DIRTY_NONE; - Viewport *viewport; + Viewport *viewport = nullptr; - bool top_level_active; - bool top_level; - bool inside_world; + bool top_level_active = false; + bool top_level = false; + bool inside_world = false; - int children_lock; - Node3D *parent; + int children_lock = 0; + Node3D *parent = nullptr; List<Node3D *> children; - List<Node3D *>::Element *C; + List<Node3D *>::Element *C = nullptr; - bool ignore_notification; - bool notify_local_transform; - bool notify_transform; + bool ignore_notification = false; + bool notify_local_transform = false; + bool notify_transform = false; - bool visible; - bool disable_scale; + bool visible = true; + bool disable_scale = false; #ifdef TOOLS_ENABLED Ref<Node3DGizmo> gizmo; - bool gizmo_disabled; - bool gizmo_dirty; + bool gizmo_disabled = false; + bool gizmo_dirty = false; #endif } data; @@ -197,7 +197,6 @@ public: void force_update_transform(); Node3D(); - ~Node3D(); }; #endif // NODE_3D_H diff --git a/scene/3d/path_3d.cpp b/scene/3d/path_3d.cpp index ae6bbad8bf..54e6330722 100644 --- a/scene/3d/path_3d.cpp +++ b/scene/3d/path_3d.cpp @@ -385,14 +385,3 @@ void PathFollow3D::set_loop(bool p_loop) { bool PathFollow3D::has_loop() const { return loop; } - -PathFollow3D::PathFollow3D() { - offset = 0; - delta_offset = 0; - h_offset = 0; - v_offset = 0; - path = nullptr; - rotation_mode = ROTATION_XYZ; - cubic = true; - loop = true; -} diff --git a/scene/3d/path_3d.h b/scene/3d/path_3d.h index 1b0f5fa4e0..39f04f1556 100644 --- a/scene/3d/path_3d.h +++ b/scene/3d/path_3d.h @@ -65,14 +65,14 @@ public: }; private: - Path3D *path; - real_t delta_offset; // change in offset since last _update_transform - real_t offset; - real_t h_offset; - real_t v_offset; - bool cubic; - bool loop; - RotationMode rotation_mode; + Path3D *path = nullptr; + real_t delta_offset = 0; // Change in offset since last _update_transform. + real_t offset = 0; + real_t h_offset = 0; + real_t v_offset = 0; + bool cubic = true; + bool loop = true; + RotationMode rotation_mode = ROTATION_XYZ; void _update_transform(bool p_update_xyz_rot = true); @@ -106,7 +106,7 @@ public: String get_configuration_warning() const override; - PathFollow3D(); + PathFollow3D() {} }; VARIANT_ENUM_CAST(PathFollow3D::RotationMode); diff --git a/scene/3d/xr_nodes.cpp b/scene/3d/xr_nodes.cpp index 763461880f..5d48795dc1 100644 --- a/scene/3d/xr_nodes.cpp +++ b/scene/3d/xr_nodes.cpp @@ -247,7 +247,7 @@ void XRController3D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_joystick_axis", "axis"), &XRController3D::get_joystick_axis); ClassDB::bind_method(D_METHOD("get_is_active"), &XRController3D::get_is_active); - ClassDB::bind_method(D_METHOD("get_hand"), &XRController3D::get_hand); + ClassDB::bind_method(D_METHOD("get_tracker_hand"), &XRController3D::get_tracker_hand); ClassDB::bind_method(D_METHOD("get_rumble"), &XRController3D::get_rumble); ClassDB::bind_method(D_METHOD("set_rumble", "rumble"), &XRController3D::set_rumble); @@ -349,7 +349,7 @@ bool XRController3D::get_is_active() const { return is_active; }; -XRPositionalTracker::TrackerHand XRController3D::get_hand() const { +XRPositionalTracker::TrackerHand XRController3D::get_tracker_hand() const { // get our XRServer XRServer *xr_server = XRServer::get_singleton(); ERR_FAIL_NULL_V(xr_server, XRPositionalTracker::TRACKER_HAND_UNKNOWN); @@ -359,7 +359,7 @@ XRPositionalTracker::TrackerHand XRController3D::get_hand() const { return XRPositionalTracker::TRACKER_HAND_UNKNOWN; }; - return tracker->get_hand(); + return tracker->get_tracker_hand(); }; String XRController3D::get_configuration_warning() const { diff --git a/scene/3d/xr_nodes.h b/scene/3d/xr_nodes.h index 751b2b68cb..6aa7709485 100644 --- a/scene/3d/xr_nodes.h +++ b/scene/3d/xr_nodes.h @@ -93,7 +93,7 @@ public: void set_rumble(real_t p_rumble); bool get_is_active() const; - XRPositionalTracker::TrackerHand get_hand() const; + XRPositionalTracker::TrackerHand get_tracker_hand() const; Ref<Mesh> get_mesh() const; |