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

Fix DistanceJoint distance limits #286

Merged
merged 4 commits into from
Dec 28, 2023
Merged

Fix DistanceJoint distance limits #286

merged 4 commits into from
Dec 28, 2023

Conversation

Jondolf
Copy link
Owner

@Jondolf Jondolf commented Dec 28, 2023

Objective

Currently, the distance limits in DistanceJoint don't actually work, and it always just uses the rest length instead.

Solution

If distance limits are specified, use them, otherwise use the rest length. Eventually, we should probably just remove the rest length in favor of only the min/max distance limits.

I also managed to clean up and optimize the limit handling a bit by making DistanceLimit::compute_correction return the correction direction and magnitude separately.

@Jondolf Jondolf added bugfix A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on labels Dec 28, 2023
@Jondolf Jondolf merged commit ae73527 into main Dec 28, 2023
4 checks passed
@Jondolf Jondolf deleted the fix-distance-joint-limits branch December 28, 2023 13:20
@Jondolf Jondolf added C-Bug Something isn't working and removed bugfix labels Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on C-Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant