-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
feature: Add DistanceJoint and 2D and 3D examples. #105
Conversation
Thanks, looks great! I'm glad that the constraints are understandable enough that people can make new constraints like this. The main difference between this distance constraint and the spherical joint is that the spherical joint doesn't allow any relative translation, while the distance constraint allows 1 or 2 (2D/3D) translational DOFs. The spherical joint also has optional swing and twist limits to constrain the relative orientation. I added a comment to clarify the |
Thanks for the kind words and the explanation for the difference between distance joint and spherical joint. Honestly after I wrote the code and started writing the documentation, I had a jolt when I saw spherical joint's description and I wondered if I had just reimplemented it for no benefit (other than my own challenge). Glad that wasn't the case. Look forward to putting this to use. Thanks for the speedy reply. I'm impressed with the pace of work I've seen on this project. |
Thanks :) |
Yes. Absolutely. -Shane
|
Hi,
This is a really cool project you've put together. I was using Rapier before this, and I really wanted a spring joint which isn't supported there. I hoped to find it here, but better than finding it I found that the XPBD means of expressing constraints and joints is so much easier to work with that I put one together myself that I hope you'll find useful.
Taking note from other XPBD implementations, I called this a DistanceJoint. When it's compliance does not equal 0 though it very much behaves like a spring joint.
I added examples in 2D and 3D. Here are some gifs on them.
One problem I didn't tackle was if you look at the heading describing a SphericalJoint and a DistanceJoint, they're not terribly distinct. However, upon inspection SphericalJoint is doing more than DistanceJoint. I wonder if there's a clearer way to discriminate between them in their one line descriptions.
Thanks for the code, and thanks for turning me onto the the XPBD methodology. Happy hacking!