summaryrefslogtreecommitdiff
path: root/servers/physics_2d/joints_2d_sw.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-02-01 00:42:00 -0500
committerAaron Franke <arnfranke@yahoo.com>2021-06-03 12:04:57 -0400
commit94bc0bd9193d5e361bbe657d59a492467f129721 (patch)
tree2adf53e9a8efb9d027961eeb0c5726e47be9bbe1 /servers/physics_2d/joints_2d_sw.cpp
parentf288a79482ad5272d872fdc84fdb64a228334d8e (diff)
Rename Vector2 clamped to limit_length and add limit_length to Vector3
Diffstat (limited to 'servers/physics_2d/joints_2d_sw.cpp')
-rw-r--r--servers/physics_2d/joints_2d_sw.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/physics_2d/joints_2d_sw.cpp b/servers/physics_2d/joints_2d_sw.cpp
index eaec582f9b..5a0a628fbc 100644
--- a/servers/physics_2d/joints_2d_sw.cpp
+++ b/servers/physics_2d/joints_2d_sw.cpp
@@ -322,7 +322,7 @@ bool GrooveJoint2DSW::setup(real_t p_step) {
Vector2 delta = (B->get_transform().get_origin() + rB) - (A->get_transform().get_origin() + rA);
real_t _b = get_bias();
- gbias = (delta * -(_b == 0 ? space->get_constraint_bias() : _b) * (1.0 / p_step)).clamped(get_max_bias());
+ gbias = (delta * -(_b == 0 ? space->get_constraint_bias() : _b) * (1.0 / p_step)).limit_length(get_max_bias());
correct = true;
return true;
@@ -348,7 +348,7 @@ void GrooveJoint2DSW::solve(real_t p_step) {
Vector2 jOld = jn_acc;
j += jOld;
- jn_acc = (((clamp * j.cross(xf_normal)) > 0) ? j : j.project(xf_normal)).clamped(jn_max);
+ jn_acc = (((clamp * j.cross(xf_normal)) > 0) ? j : j.project(xf_normal)).limit_length(jn_max);
j = jn_acc - jOld;