Merge pull request #27462 from ShyRed/fixgroovejoint2d

Replace hardcoded GrooveJoint2D bias with user provided bias
This commit is contained in:
Rémi Verschelde 2019-04-05 15:20:46 +02:00 committed by GitHub
commit bf104e78ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -299,9 +299,7 @@ bool GrooveJoint2DSW::setup(real_t p_step) {
Vector2 delta = (B->get_transform().get_origin() + rB) - (A->get_transform().get_origin() + rA);
// FIXME: We used to do this assignment and then override it with 0.001 right after. Investigate why.
//real_t _b = get_bias();
real_t _b = 0.001;
real_t _b = get_bias();
gbias = (delta * -(_b == 0 ? space->get_constraint_bias() : _b) * (1.0 / p_step)).clamped(get_max_bias());
// apply accumulated impulse