diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2021-02-01 00:42:00 -0500 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2021-06-03 12:04:57 -0400 |
commit | 94bc0bd9193d5e361bbe657d59a492467f129721 (patch) | |
tree | 2adf53e9a8efb9d027961eeb0c5726e47be9bbe1 /servers/physics_2d/joints_2d_sw.cpp | |
parent | f288a79482ad5272d872fdc84fdb64a228334d8e (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.cpp | 4 |
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; |