Elastic Constraints

Post Reply
br3ton
Posts: 2
Joined: Thu Aug 30, 2018 10:40 am

Elastic Constraints

Post 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?
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Elastic Constraints

Post 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).
SpeedASS
Posts: 2
Joined: Mon Feb 08, 2021 2:11 pm

Re: Elastic Constraints

Post by SpeedASS »

Hi,br3ton.have you found the solution? I'm facing the same problem,thanks
User avatar
Octavius_Ace
Posts: 20
Joined: Sat Jun 04, 2016 10:34 pm
Location: Edinburgh

Re: Elastic Constraints

Post 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?
Post Reply