summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/audio_stream_player_3d.cpp4
-rw-r--r--scene/3d/skeleton_ik_3d.cpp12
-rw-r--r--scene/animation/animation_player.cpp4
-rw-r--r--scene/animation/animation_tree.cpp4
-rw-r--r--scene/gui/gradient_edit.cpp2
-rw-r--r--scene/gui/graph_edit.cpp6
-rw-r--r--scene/gui/text_edit.cpp7
-rw-r--r--scene/gui/text_edit.h1
-rw-r--r--scene/resources/animation.cpp4
-rw-r--r--scene/resources/curve.cpp4
-rw-r--r--scene/resources/gradient.h2
11 files changed, 33 insertions, 17 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index 097368853e..28a8b01437 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -556,7 +556,7 @@ void AudioStreamPlayer3D::_notification(int p_what) {
for (int i = 0; i < vol_index_max; i++) {
- output.reverb_vol[i] = output.reverb_vol[i].linear_interpolate(center_frame, attenuation);
+ output.reverb_vol[i] = output.reverb_vol[i].lerp(center_frame, attenuation);
}
} else {
for (int i = 0; i < vol_index_max; i++) {
@@ -567,7 +567,7 @@ void AudioStreamPlayer3D::_notification(int p_what) {
for (int i = 0; i < vol_index_max; i++) {
- output.reverb_vol[i] = output.vol[i].linear_interpolate(output.reverb_vol[i] * attenuation, uniformity);
+ output.reverb_vol[i] = output.vol[i].lerp(output.reverb_vol[i] * attenuation, uniformity);
output.reverb_vol[i] *= area_send;
}
diff --git a/scene/3d/skeleton_ik_3d.cpp b/scene/3d/skeleton_ik_3d.cpp
index 7366290ed3..10bdd71d73 100644
--- a/scene/3d/skeleton_ik_3d.cpp
+++ b/scene/3d/skeleton_ik_3d.cpp
@@ -287,14 +287,22 @@ void FabrikInverseKinematic::solve(Task *p_task, real_t blending_delta, bool ove
return; // Skip solving
}
- p_task->skeleton->clear_bones_global_pose_override();
+ p_task->skeleton->set_bone_global_pose_override(p_task->chain.chain_root.bone, Transform(), 0.0, true);
+
+ if (p_task->chain.middle_chain_item) {
+ p_task->skeleton->set_bone_global_pose_override(p_task->chain.middle_chain_item->bone, Transform(), 0.0, true);
+ }
+
+ for (int i = 0; i < p_task->chain.tips.size(); i += 1) {
+ p_task->skeleton->set_bone_global_pose_override(p_task->chain.tips[i].chain_item->bone, Transform(), 0.0, true);
+ }
make_goal(p_task, p_task->skeleton->get_global_transform().affine_inverse().scaled(p_task->skeleton->get_global_transform().get_basis().get_scale()), blending_delta);
update_chain(p_task->skeleton, &p_task->chain.chain_root);
if (p_use_magnet && p_task->chain.middle_chain_item) {
- p_task->chain.magnet_position = p_task->chain.middle_chain_item->initial_transform.origin.linear_interpolate(p_magnet_position, blending_delta);
+ p_task->chain.magnet_position = p_task->chain.middle_chain_item->initial_transform.origin.lerp(p_magnet_position, blending_delta);
solve_simple(p_task, true);
}
solve_simple(p_task, false);
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 946f759610..9ef6b9864a 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -395,9 +395,9 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float
} else {
- nc->loc_accum = nc->loc_accum.linear_interpolate(loc, p_interp);
+ nc->loc_accum = nc->loc_accum.lerp(loc, p_interp);
nc->rot_accum = nc->rot_accum.slerp(rot, p_interp);
- nc->scale_accum = nc->scale_accum.linear_interpolate(scale, p_interp);
+ nc->scale_accum = nc->scale_accum.lerp(scale, p_interp);
}
} break;
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp
index f8b3ca291b..56e224819f 100644
--- a/scene/animation/animation_tree.cpp
+++ b/scene/animation/animation_tree.cpp
@@ -958,7 +958,7 @@ void AnimationTree::_process_graph(float p_delta) {
if (err != OK)
continue;
- t->loc = t->loc.linear_interpolate(loc, blend);
+ t->loc = t->loc.lerp(loc, blend);
if (t->rot_blend_accum == 0) {
t->rot = rot;
t->rot_blend_accum = blend;
@@ -967,7 +967,7 @@ void AnimationTree::_process_graph(float p_delta) {
t->rot = rot.slerp(t->rot, t->rot_blend_accum / rot_total).normalized();
t->rot_blend_accum = rot_total;
}
- t->scale = t->scale.linear_interpolate(scale, blend);
+ t->scale = t->scale.lerp(scale, blend);
}
} break;
diff --git a/scene/gui/gradient_edit.cpp b/scene/gui/gradient_edit.cpp
index 88107f754c..a6ed3d8de9 100644
--- a/scene/gui/gradient_edit.cpp
+++ b/scene/gui/gradient_edit.cpp
@@ -207,7 +207,7 @@ void GradientEdit::_gui_input(const Ref<InputEvent> &p_event) {
prev = points[pos];
}
- newPoint.color = prev.color.linear_interpolate(next.color, (newPoint.offset - prev.offset) / (next.offset - prev.offset));
+ newPoint.color = prev.color.lerp(next.color, (newPoint.offset - prev.offset) / (next.offset - prev.offset));
points.push_back(newPoint);
points.sort();
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index 3af730de23..0bf67df9b4 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -653,7 +653,7 @@ void GraphEdit::_bake_segment2d(Vector<Vector2> &points, Vector<Color> &colors,
if (p_depth >= p_min_depth && (dp < p_tol || p_depth >= p_max_depth)) {
points.push_back((beg + end) * 0.5);
- colors.push_back(p_color.linear_interpolate(p_to_color, mp));
+ colors.push_back(p_color.lerp(p_to_color, mp));
lines++;
} else {
_bake_segment2d(points, colors, p_begin, mp, p_a, p_out, p_b, p_in, p_depth + 1, p_min_depth, p_max_depth, p_tol, p_color, p_to_color, lines);
@@ -737,8 +737,8 @@ void GraphEdit::_connections_layer_draw() {
Color tocolor = gto->get_connection_input_color(E->get().to_port);
if (E->get().activity > 0) {
- color = color.linear_interpolate(activity_color, E->get().activity);
- tocolor = tocolor.linear_interpolate(activity_color, E->get().activity);
+ color = color.lerp(activity_color, E->get().activity);
+ tocolor = tocolor.lerp(activity_color, E->get().activity);
}
_draw_cos_line(connections_layer, frompos, topos, color, tocolor);
}
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 2d63d86048..9ee7456d26 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -6215,6 +6215,10 @@ void TextEdit::_push_current_op() {
current_op.type = TextOperation::TYPE_NONE;
current_op.text = "";
current_op.chain_forward = false;
+
+ if (undo_stack.size() > undo_stack_max_size) {
+ undo_stack.pop_front();
+ }
}
void TextEdit::set_indent_using_spaces(const bool p_use_spaces) {
@@ -7239,6 +7243,8 @@ void TextEdit::_bind_methods() {
GLOBAL_DEF("gui/timers/text_edit_idle_detect_sec", 3);
ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/text_edit_idle_detect_sec", PropertyInfo(Variant::FLOAT, "gui/timers/text_edit_idle_detect_sec", PROPERTY_HINT_RANGE, "0,10,0.01,or_greater")); // No negative numbers.
+ GLOBAL_DEF("gui/common/text_edit_undo_stack_max_size", 1024);
+ ProjectSettings::get_singleton()->set_custom_property_info("gui/common/text_edit_undo_stack_max_size", PropertyInfo(Variant::INT, "gui/common/text_edit_undo_stack_max_size", PROPERTY_HINT_RANGE, "0,10000,1,or_greater")); // No negative numbers.
}
TextEdit::TextEdit() {
@@ -7318,6 +7324,7 @@ TextEdit::TextEdit() {
current_op.type = TextOperation::TYPE_NONE;
undo_enabled = true;
+ undo_stack_max_size = GLOBAL_GET("gui/common/text_edit_undo_stack_max_size");
undo_stack_pos = nullptr;
setting_text = false;
last_dblclk = 0;
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index ef8c39d32f..ac8eb5da1d 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -306,6 +306,7 @@ private:
List<TextOperation> undo_stack;
List<TextOperation>::Element *undo_stack_pos;
+ int undo_stack_max_size;
void _clear_redo();
void _do_text_op(const TextOperation &p_op, bool p_reverse);
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index aa4c9bf225..ea4338519e 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -1570,7 +1570,7 @@ Animation::TransformKey Animation::_interpolate(const Animation::TransformKey &p
Vector3 Animation::_interpolate(const Vector3 &p_a, const Vector3 &p_b, float p_c) const {
- return p_a.linear_interpolate(p_b, p_c);
+ return p_a.lerp(p_b, p_c);
}
Quat Animation::_interpolate(const Quat &p_a, const Quat &p_b, float p_c) const {
@@ -2432,7 +2432,7 @@ float Animation::bezier_track_interpolate(int p_track, float p_time) const {
Vector2 high_pos = _bezier_interp(high, start, start_out, end_in, end);
float c = (t - low_pos.x) / (high_pos.x - low_pos.x);
- return low_pos.linear_interpolate(high_pos, c).y;
+ return low_pos.lerp(high_pos, c).y;
}
int Animation::audio_track_insert_key(int p_track, float p_time, const RES &p_stream, float p_start_offset, float p_end_offset) {
diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp
index d19eae0d4f..ae705a47e8 100644
--- a/scene/resources/curve.cpp
+++ b/scene/resources/curve.cpp
@@ -796,7 +796,7 @@ Vector2 Curve2D::interpolate_baked(float p_offset, bool p_cubic) const {
Vector2 post = (idx < (bpc - 2)) ? r[idx + 2] : r[idx + 1];
return r[idx].cubic_interpolate(r[idx + 1], pre, post, frac);
} else {
- return r[idx].linear_interpolate(r[idx + 1], frac);
+ return r[idx].lerp(r[idx + 1], frac);
}
}
@@ -1354,7 +1354,7 @@ Vector3 Curve3D::interpolate_baked(float p_offset, bool p_cubic) const {
Vector3 post = (idx < (bpc - 2)) ? r[idx + 2] : r[idx + 1];
return r[idx].cubic_interpolate(r[idx + 1], pre, post, frac);
} else {
- return r[idx].linear_interpolate(r[idx + 1], frac);
+ return r[idx].lerp(r[idx + 1], frac);
}
}
diff --git a/scene/resources/gradient.h b/scene/resources/gradient.h
index 2d98f799e2..573749ea7e 100644
--- a/scene/resources/gradient.h
+++ b/scene/resources/gradient.h
@@ -120,7 +120,7 @@ public:
return points[0].color;
const Point &pointFirst = points[first];
const Point &pointSecond = points[second];
- return pointFirst.color.linear_interpolate(pointSecond.color, (p_offset - pointFirst.offset) / (pointSecond.offset - pointFirst.offset));
+ return pointFirst.color.lerp(pointSecond.color, (p_offset - pointFirst.offset) / (pointSecond.offset - pointFirst.offset));
}
int get_points_count() const;