diff options
-rw-r--r-- | doc/classes/String.xml | 19 | ||||
-rw-r--r-- | editor/spatial_editor_gizmos.cpp | 6 | ||||
-rw-r--r-- | platform/android/os_android.cpp | 34 |
3 files changed, 18 insertions, 41 deletions
diff --git a/doc/classes/String.xml b/doc/classes/String.xml index e0a4a24299..11a9f6dc0d 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -744,7 +744,15 @@ Splits the string by a [code]delimiter[/code] string and returns an array of the substrings, starting from right. The splits in the returned array are sorted in the same order as the original string, from left to right. If [code]maxsplit[/code] is specified, it defines the number of splits to do from the right up to [code]maxsplit[/code]. The default value of 0 means that all items are split, thus giving the same result as [method split]. - For example, [code]"One,Two,Three,Four"[/code] will return [code]["Three","Four"][/code] if split by [code]","[/code] with a [code]maxsplit[/code] value of 2. + Example: + [codeblock] + var some_string = "One,Two,Three,Four" + var some_array = some_string.rsplit(",", true, 1) + print(some_array.size()) # Prints 2 + print(some_array[0]) # Prints "Four" + print(some_array[1]) # Prints "Three,Two,One" + [/codeblock] + </description> </method> <method name="rstrip"> @@ -805,7 +813,14 @@ <description> Splits the string by a [code]delimiter[/code] string and returns an array of the substrings. If [code]maxsplit[/code] is specified, it defines the number of splits to do from the left up to [code]maxsplit[/code]. The default value of 0 means that all items are split. - For example, [code]"One,Two,Three"[/code] will return [code]["One","Two"][/code] if split by [code]","[/code] with a [code]maxsplit[/code] value of 2. + Example: + [codeblock] + var some_string = "One,Two,Three,Four" + var some_array = some_string.split(",", true, 1) + print(some_array.size()) # Prints 2 + print(some_array[0]) # Prints "One" + print(some_array[1]) # Prints "Two,Three,Four" + [/codeblock] </description> </method> <method name="split_floats"> diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 16da2771b9..cfd9ec19d2 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -490,7 +490,6 @@ bool EditorSpatialGizmo::intersect_ray(Camera *p_camera, const Point2 &p_point, if (r_gizmo_handle && !hidden) { Transform t = spatial_node->get_global_transform(); - t.orthonormalize(); if (billboard_handle) { t.set_look_at(t.origin, t.origin - p_camera->get_transform().basis.get_axis(2), p_camera->get_transform().basis.get_axis(1)); } @@ -551,7 +550,6 @@ bool EditorSpatialGizmo::intersect_ray(Camera *p_camera, const Point2 &p_point, if (selectable_icon_size > 0.0f) { Transform t = spatial_node->get_global_transform(); - t.orthonormalize(); Vector3 camera_position = p_camera->get_camera_transform().origin; if (camera_position.distance_squared_to(t.origin) > 0.01) { t.set_look_at(t.origin, camera_position, Vector3(0, 1, 0)); @@ -861,7 +859,6 @@ void LightSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Light *light = Object::cast_to<Light>(p_gizmo->get_spatial_node()); Transform gt = light->get_global_transform(); - gt.orthonormalize(); Transform gi = gt.affine_inverse(); Vector3 ray_from = p_camera->project_ray_origin(p_point); @@ -1106,7 +1103,6 @@ void AudioStreamPlayer3DSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_giz AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node()); Transform gt = player->get_global_transform(); - gt.orthonormalize(); Transform gi = gt.affine_inverse(); Vector3 ray_from = p_camera->project_ray_origin(p_point); @@ -1266,7 +1262,6 @@ void CameraSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node()); Transform gt = camera->get_global_transform(); - gt.orthonormalize(); Transform gi = gt.affine_inverse(); Vector3 ray_from = p_camera->project_ray_origin(p_point); @@ -3234,7 +3229,6 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i return; Transform gt = cs->get_global_transform(); - gt.orthonormalize(); Transform gi = gt.affine_inverse(); Vector3 ray_from = p_camera->project_ray_origin(p_point); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 9156181bbe..defee8f1f1 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -49,9 +49,6 @@ #include "java_godot_io_wrapper.h" #include "java_godot_wrapper.h" -#define PAN_GESTURE_MIN_DELTA 5 // only advertise PanGesture event with dx and dy greater than this -#define MAGNIFY_GESTURE_MIN_FACTOR 0.1 // only advertise MagnifyGesture event with a factor difference from 1.0 greater than this - class AndroidLogger : public Logger { public: virtual void logv(const char *p_format, va_list p_list, bool p_err) { @@ -409,35 +406,6 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ERR_FAIL_COND(touch.size() != p_points.size()); - if (touch.size() == 1) { - Point2 d = (p_points[0].pos - touch.write[0].pos); - if (fabs(d.x) > PAN_GESTURE_MIN_DELTA || fabs(d.y) > PAN_GESTURE_MIN_DELTA) { - Ref<InputEventPanGesture> ev; - ev.instance(); - ev->set_position(p_points[0].pos); - ev->set_delta(d); - input->parse_input_event(ev); - touch.write[0].pos = p_points[0].pos; - } - } else if (touch.size() == 2) { - Point2 v0 = touch[1].pos - touch[0].pos; - float l0 = (v0.x * v0.x) + (v0.y * v0.y); - if (l0 != 0.0) { - Point2 v1 = p_points[1].pos - p_points[0].pos; - float l1 = (v1.x * v1.x) + (v1.y * v1.y); - float f = (l1 / l0); - if (fabs(f - 1.0) > MAGNIFY_GESTURE_MIN_FACTOR) { - Ref<InputEventMagnifyGesture> ev; - ev.instance(); - ev->set_position(p_points[0].pos + v1 / 2); - ev->set_factor(sqrt(f)); - input->parse_input_event(ev); - touch.write[0].pos = p_points[0].pos; - touch.write[1].pos = p_points[1].pos; - } - } - } - for (int i = 0; i < touch.size(); i++) { int idx = -1; @@ -452,7 +420,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> ERR_CONTINUE(idx == -1); if (touch[i].pos == p_points[idx].pos) - continue; //no unnecessary move + continue; //no move unncesearily Ref<InputEventScreenDrag> ev; ev.instance(); |