Page 1 of 1

Elastic Constraints

Posted: Tue Apr 16, 2019 11:15 am
by br3ton
Hi all,

I'm trying to constrain a physics capsule to a kinematic sphere that I am moving around the world. I am able to constrain them successfully but the constraint seems to stretch when moving the sphere large position jumps (the capsule doesn't keep up with the sphere and the constraint acts like an elastic band).

I've tried various things I've seen around the bullet forums with upping constraint iterations as well as messing with the CFM / ERP values but nothing seems to work.

Does anybody have any suggestions on how I can fix this?

Re: Elastic Constraints

Posted: Tue Apr 16, 2019 8:25 pm
by drleviathan
How does the sphere move so quickly? Via a collision or do you slam its position/velocity through some non-physical logic? Is it kinematic?

I'm asking because if you are moving the Sphere in a violent and non-physical way I could see how a constraint would have trouble keeping up. And if you're doing that then one idea occurs to me: track the lastKnownRelativeTransform of Capsule to Sphere at the end of each frame, and when you move the Sphere violently then apply the same world-frame delta (transform and/or velocity) to the Capsule a priori at the same time (e.g. maintain lastKnownRelativeTransform before the next step). Then when it comes time for the ConstraintSovler to enforce the constraint it will at least be as close to the correct solution as it was at the end of last timestep.

You could think of this as a custom single-step Verlet integration step.

Of course, that idea would kinda fail (very non-physical results) if the Capsule had much sway over the Sphere's motion (e.g. if the Capsule were a significant fraction or large multiple of the Sphere's mass).

Re: Elastic Constraints

Posted: Mon Feb 08, 2021 2:49 pm
by SpeedASS
Hi,br3ton.have you found the solution? I'm facing the same problem,thanks

Re: Elastic Constraints

Posted: Tue Feb 09, 2021 2:43 pm
by Octavius_Ace
Are all of your constrained object dimensions > 0.2 units?
Are your masses reasonably similar?
Are you introducing very large position deltas from one sim step to the next?