diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/visibility_notifier_2d.cpp | 17 | ||||
-rw-r--r-- | scene/3d/camera_3d.cpp | 2 | ||||
-rw-r--r-- | scene/3d/xr_nodes.cpp | 2 | ||||
-rw-r--r-- | scene/gui/line_edit.cpp | 4 | ||||
-rw-r--r-- | scene/resources/curve.cpp | 4 | ||||
-rw-r--r-- | scene/resources/mesh.cpp | 2 | ||||
-rw-r--r-- | scene/resources/mesh_data_tool.cpp | 2 | ||||
-rw-r--r-- | scene/resources/surface_tool.cpp | 6 | ||||
-rw-r--r-- | scene/resources/world_margin_shape_3d.cpp | 12 |
9 files changed, 32 insertions, 19 deletions
diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index c374dd5faa..780d08693d 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -248,10 +248,19 @@ void VisibilityEnabler2D::_notification(int p_what) { _find_nodes(from); - if (enabler[ENABLER_PARENT_PHYSICS_PROCESS] && get_parent()) - get_parent()->set_physics_process(false); - if (enabler[ENABLER_PARENT_PROCESS] && get_parent()) - get_parent()->set_process(false); + // We need to defer the call of set_process and set_physics_process, + // otherwise they are overwritten inside NOTIFICATION_READY. + // We can't use call_deferred, because it happens after a physics frame. + // The ready signal works as it's emitted immediately after NOTIFICATION_READY. + + if (enabler[ENABLER_PARENT_PHYSICS_PROCESS] && get_parent()) { + get_parent()->connect(SceneStringNames::get_singleton()->ready, + callable_mp(get_parent(), &Node::set_physics_process), varray(false), CONNECT_ONESHOT); + } + if (enabler[ENABLER_PARENT_PROCESS] && get_parent()) { + get_parent()->connect(SceneStringNames::get_singleton()->ready, + callable_mp(get_parent(), &Node::set_process), varray(false), CONNECT_ONESHOT); + } } if (p_what == NOTIFICATION_EXIT_TREE) { diff --git a/scene/3d/camera_3d.cpp b/scene/3d/camera_3d.cpp index 7d02befee6..871f3119bc 100644 --- a/scene/3d/camera_3d.cpp +++ b/scene/3d/camera_3d.cpp @@ -376,7 +376,7 @@ Point2 Camera3D::unproject_position(const Vector3 &p_pos) const { Plane p(get_camera_transform().xform_inv(p_pos), 1.0); p = cm.xform4(p); - p.normal /= p.distance; + p.normal /= p.d; Point2 res; res.x = (p.normal.x * 0.5 + 0.5) * viewport_size.x; diff --git a/scene/3d/xr_nodes.cpp b/scene/3d/xr_nodes.cpp index 05e282533b..6f41629bac 100644 --- a/scene/3d/xr_nodes.cpp +++ b/scene/3d/xr_nodes.cpp @@ -111,7 +111,7 @@ Point2 XRCamera3D::unproject_position(const Vector3 &p_pos) const { Plane p(get_camera_transform().xform_inv(p_pos), 1.0); p = cm.xform4(p); - p.normal /= p.distance; + p.normal /= p.d; Point2 res; res.x = (p.normal.x * 0.5 + 0.5) * viewport_size.x; diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 8574b05016..bb177ae0e7 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -277,10 +277,14 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { } break; #ifdef APPLE_STYLE_KEYS case (KEY_LEFT): { // Go to start of text - like HOME key. + shift_selection_check_pre(k->get_shift()); set_cursor_position(0); + shift_selection_check_post(k->get_shift()); } break; case (KEY_RIGHT): { // Go to end of text - like END key. + shift_selection_check_pre(k->get_shift()); set_cursor_position(text.length()); + shift_selection_check_post(k->get_shift()); } break; #endif default: { diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index d96013a081..ae705a47e8 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -1237,7 +1237,7 @@ void Curve3D::_bake() const { p = mid; Plane post; post.normal = pos; - post.distance = Math::lerp(points[i].tilt, points[i + 1].tilt, mid); + post.d = Math::lerp(points[i].tilt, points[i + 1].tilt, mid); pointlist.push_back(post); } else { @@ -1274,7 +1274,7 @@ void Curve3D::_bake() const { for (List<Plane>::Element *E = pointlist.front(); E; E = E->next()) { w[idx] = E->get().normal; - wt[idx] = E->get().distance; + wt[idx] = E->get().d; if (!up_vector_enabled) { idx++; diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index adecf5cf8f..401b689145 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -1522,7 +1522,7 @@ Error ArrayMesh::lightmap_unwrap_cached(int *&r_cache_data, unsigned int &r_cach if (lightmap_surfaces[surface].format & ARRAY_FORMAT_TANGENT) { Plane t; t.normal = v.tangent; - t.distance = v.binormal.dot(v.normal.cross(v.tangent)) < 0 ? -1 : 1; + t.d = v.binormal.dot(v.normal.cross(v.tangent)) < 0 ? -1 : 1; surfaces_tools.write[surface]->add_tangent(t); } if (lightmap_surfaces[surface].format & ARRAY_FORMAT_BONES) { diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp index e4d402479f..76d96786bc 100644 --- a/scene/resources/mesh_data_tool.cpp +++ b/scene/resources/mesh_data_tool.cpp @@ -255,7 +255,7 @@ Error MeshDataTool::commit_to_surface(const Ref<ArrayMesh> &p_mesh) { ta[i * 4 + 0] = vtx.tangent.normal.x; ta[i * 4 + 1] = vtx.tangent.normal.y; ta[i * 4 + 2] = vtx.tangent.normal.z; - ta[i * 4 + 3] = vtx.tangent.distance; + ta[i * 4 + 3] = vtx.tangent.d; } if (uv) uv[i] = vtx.uv; diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index c5e1aa7c80..4b392e23b7 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -107,7 +107,7 @@ void SurfaceTool::add_vertex(const Vector3 &p_vertex) { vtx.weights = last_weights; vtx.bones = last_bones; vtx.tangent = last_tangent.normal; - vtx.binormal = last_normal.cross(last_tangent.normal).normalized() * last_tangent.distance; + vtx.binormal = last_normal.cross(last_tangent.normal).normalized() * last_tangent.d; const int expected_vertices = 4; @@ -575,7 +575,7 @@ Vector<SurfaceTool::Vertex> SurfaceTool::create_vertex_array_from_triangle_array if (lformat & RS::ARRAY_FORMAT_TANGENT) { Plane p(tarr[i * 4 + 0], tarr[i * 4 + 1], tarr[i * 4 + 2], tarr[i * 4 + 3]); v.tangent = p.normal; - v.binormal = p.normal.cross(v.tangent).normalized() * p.distance; + v.binormal = p.normal.cross(v.tangent).normalized() * p.d; } if (lformat & RS::ARRAY_FORMAT_COLOR) v.color = carr[i]; @@ -658,7 +658,7 @@ void SurfaceTool::_create_list_from_arrays(Array arr, List<Vertex> *r_vertex, Li if (lformat & RS::ARRAY_FORMAT_TANGENT) { Plane p(tarr[i * 4 + 0], tarr[i * 4 + 1], tarr[i * 4 + 2], tarr[i * 4 + 3]); v.tangent = p.normal; - v.binormal = p.normal.cross(v.tangent).normalized() * p.distance; + v.binormal = p.normal.cross(v.tangent).normalized() * p.d; } if (lformat & RS::ARRAY_FORMAT_COLOR) v.color = carr[i]; diff --git a/scene/resources/world_margin_shape_3d.cpp b/scene/resources/world_margin_shape_3d.cpp index 833e7725ae..aa96f8aa68 100644 --- a/scene/resources/world_margin_shape_3d.cpp +++ b/scene/resources/world_margin_shape_3d.cpp @@ -41,10 +41,10 @@ Vector<Vector3> WorldMarginShape3D::get_debug_mesh_lines() { Vector3 n2 = p.normal.cross(n1).normalized(); Vector3 pface[4] = { - p.normal * p.distance + n1 * 10.0 + n2 * 10.0, - p.normal * p.distance + n1 * 10.0 + n2 * -10.0, - p.normal * p.distance + n1 * -10.0 + n2 * -10.0, - p.normal * p.distance + n1 * -10.0 + n2 * 10.0, + p.normal * p.d + n1 * 10.0 + n2 * 10.0, + p.normal * p.d + n1 * 10.0 + n2 * -10.0, + p.normal * p.d + n1 * -10.0 + n2 * -10.0, + p.normal * p.d + n1 * -10.0 + n2 * 10.0, }; points.push_back(pface[0]); @@ -55,8 +55,8 @@ Vector<Vector3> WorldMarginShape3D::get_debug_mesh_lines() { points.push_back(pface[3]); points.push_back(pface[3]); points.push_back(pface[0]); - points.push_back(p.normal * p.distance); - points.push_back(p.normal * p.distance + p.normal * 3); + points.push_back(p.normal * p.d); + points.push_back(p.normal * p.d + p.normal * 3); return points; } |