Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement an un-damped length constraint #159

Closed
Joshua-Ashton opened this issue May 13, 2022 · 5 comments
Closed

Implement an un-damped length constraint #159

Joshua-Ashton opened this issue May 13, 2022 · 5 comments

Comments

@Joshua-Ashton
Copy link
Contributor

Maybe I am misunderstanding the comment here, but what I want is to be able to really pull on it with a lot and it never exceed the maximum length of the rope (like the Point constraints but with a minLength.)

@Joshua-Ashton
Copy link
Contributor Author

Looks like this problem was made a lot worse by what I encountered with #150 (comment)

There is still some tiny amount of give compared to ballsockets it seems, but a lot more negligable. Would still be nice to not have it potentially thoigh,

@jrouwe
Copy link
Owner

jrouwe commented May 13, 2022

I'm guessing this is about the comment in DistanceConstraint.h?

/// Note that due to the way the damping is implemented, it is impossible to get an undamped oscillation. See comment in AxisConstraintPart::CalculateConstraintProperties.

What it basically means is that if you set frequency and damping to 0 there should not be any oscillation and the constraint will be as stiff as possible. But due to the way the whole simulation is integrated (with an implicit Euler integrator), in practice you will always have damping and some softness. If you don't then the simulation tends to explode.

My guess is that the point constraints (ball and socket) are stiffer because they remove 3 degrees of freedom and distance constraints only 1. If you want to make a fixed length rope out of sticks I would use the point constraint.

@Joshua-Ashton
Copy link
Contributor Author

I guess if it makes the constraints explode that makes sense. I have had constraints explode with Jolt sometimes, but I am not sure how to make an easy repro case or if this can be fixed easily.

@jrouwe
Copy link
Owner

jrouwe commented May 13, 2022

It usually means that the forces that are pulling on the constraints are too big for the time step you take / the amount of iterations you have specified or objects with very different masses are connected. It's possible that there's a bug somewhere of course, but without a repro case it's hard to say.

jrouwe added a commit that referenced this issue May 13, 2022
@jrouwe
Copy link
Owner

jrouwe commented May 13, 2022

Documentation added. If you have an exploding simulation repro, please create a new ticket.

@jrouwe jrouwe closed this as completed May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants