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

Adjust local anchors of a ball joint #55

Open
Chargeuk opened this issue Dec 30, 2021 · 4 comments
Open

Adjust local anchors of a ball joint #55

Chargeuk opened this issue Dec 30, 2021 · 4 comments

Comments

@Chargeuk
Copy link
Contributor

Hi,
I was wondering if it would be possible to adjust the local_anchor1 and local_anchor2 values of a ball joint after the joint had been created?
I have been digging through the code, but do not know the rust language. It seems that the anchors are simply defined within the ball joint class, but I do see that other classes take copies (or references?) to their values. If a method to change the anchors was added to the ball joint, would the changed value be used throughout the system? And then could this method be exposed via the JavaScript interface?
Many thanks, Rapier looks like an awesome physics engine.

@jcyuan
Copy link
Contributor

jcyuan commented May 11, 2022

i think you can't modify it after the creation.

@Chargeuk
Copy link
Contributor Author

Hi @jcyuan - I did actually locally make this change and it worked fine. However, that was before the large number of changes made by @sebcrozet in version 0.8.x so my changes are not mergeable with the code as it stands.
Once 0.8 is out of alpha I will try to make the changes again and open a pull request against the official repo so everyone could benefit (assuming it still works).

@jcyuan
Copy link
Contributor

jcyuan commented May 20, 2022

Hi @jcyuan - I did actually locally make this change and it worked fine. However, that was before the large number of changes made by @sebcrozet in version 0.8.x so my changes are not mergeable with the code as it stands. Once 0.8 is out of alpha I will try to make the changes again and open a pull request against the official repo so everyone could benefit (assuming it still works).

sounds great~ thanks.
(assuming it still works), yep, you could test it first though lol. 👍

@Chargeuk
Copy link
Contributor Author

Hi @jcyuan - I've opened a pull request to expose the Rapier methods that change the local anchor points within Rapier.js. I also exposed the method to change the joint limits.
Please note that I am in no way a Rust dev, so I hope what I've done is ok.
Pull request here: #149

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