-
Notifications
You must be signed in to change notification settings - Fork 62
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
feat: continuation of update @dimforge/rapier3d-compat to 0.12.0 + optimizations #619
Conversation
… rope/spring joints
…s + set all integrationParams
🦋 Changeset detectedLatest commit: fd46529 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Before releasing we'll also want to docs for the new joints to README.md |
Also realised we can add the "Generic" joint too - but again, doesn't have to all be in this PR. We can add that seperately.
https://github.com/dimforge/rapier.js/blob/master/CHANGELOG.md |
@0xtito added some docs to readme.md now 🙂 |
Let me know if the changes I added look good to you @0xtito 🙂 |
beautiful! thank you all! |
Looks great to me! Thanks for the additions. There is one thing that is kinda bothering me though. The entire simulation just feels slower compared to the rapier/rapier.js examples. For example in the wrecking ball video above, the ball seems to move slow, and even when the boxes are hit they seem to fall slowly. This isn't necessarily a problem, but I do wonder why this is the case. I also think this could be discussed/dissected in another PR (unless the answer why this happens is already known, then i'd love to know why). |
just changed the text for |
is there anything else that needs to be added before the PR can be merged? I left the checklist as is, but does the default checklist apply here? |
Marked as ready for review - if there are still things needed to be done feel free to change it back to a draft! |
These changes look good to me! Let's get a review from @wiledal too.
I can take a look at this shortly. |
Changes look good to me! I'm wondering though why the performance has degraded and is now noticeably stuttery on my machine compared to the old demo -- new settings defaults? (possibly due to the Also, the contact force events are not firing like they used to 🤔 |
Regarding the performance, the performance seems to be the exact same in both environments for me. Do you think it could it could be a browser problem? I am using Arc, but could test it across different browsers to see. Not sure why that would be happening. Also regarding the contact force, that is odd. In the new |
I also realized the Spring and Joint sections were missing from the Readme topics so I just added them |
I'm on Arc as well. I double checked, and it does not stutter anymore. Sometimes I seem to get a stuttering version after random refreshes, that might not have anything to do with this update however. I'm looking at the contact force event issue. It seems it just doesn't fire anymore unless the body is almost at rest. Unclear why that would be. |
There's a clear difference between the contact force event from Rapier.js 0.11.2 and 0.12.0.
This is a plain vite setup with |
Mhmmm thats so weird. I noticed in rapier/rapier.js there is a |
Just mentioning this change, I am unsure if this is directly related, but in rapier.js v0.12, the names of link to PR here |
Another thing I have noticed is that, in the new r3-rapier, if you just let the So I changed the default I am going to keep dissecting this to see why the Here is a video of the correct_contactForceExample_numSolverIterations1.mov |
Let's also see if anyone on the rapier discord can help us, posted a message now: https://discord.com/channels/507548572338880513/748814906953826334/1204933879677329488 |
Also created an issue: dimforge/rapier.js#261 |
Thanks fellas! Since this seems to be an issue with Rapier, and not specifically this library, we'll include it as a migration caveat for this update. Edit, added here: https://github.com/pmndrs/react-three-rapier/wiki/1.2.1-to-1.3.0-Migration-guide |
Sounds great! Ya it definitely seems to be a problem with Rapier. Once they address the issue, we can merge in those changes then. Also, there are a few other things we need to add to fully upgrade to 0.12 (like integrating the |
Let me know @wiledal if there is anything else I can add/do for this PR 🙂 |
Hey @isaac-mason, do you think this PR is ready to be merged? No rush if you would like to make some additions/changes, but if not I would love for this to be merged so I can start testing it out in my library 🙂 |
I will put the repo in |
Great! Thanks @wiledal - I am using the spring joint to try to build a rapier-integrated hand for mixed reality so i will definitely be testing some edge cases. If I find any errors I will mention them here or as an issue, dependent on the error/your preference (sorry for any hassle i've caused, this is my first time meaningfully contributing to OS and I don't know the right course of action sometimes lol) |
I've done some initial tests in You should join us on the Poimandres discord for easier communication outside of the pull request context 😄 https://discord.com/channels/740090768164651008/969941082144124959 |
Description
spring
andrope
jointsr3-rapier_springjoint_example.mov
r3-rapier_ropejoint_example.mov
body1Anchor
andbody2Anchor
to react-three/fiber'sVector3
+ createdvector3ToRapierVector
.spring
andrope
joints.Vector3
objects, when all that is required is aVector3Tuple
, but a threejs Vector3 also works. So now you can pass either a threejsVector3
, aVector3Tuple
, or anumber
. If it is aVector3Tuple
, then we are just creating aRapierVector
which is essentially an object withx
,y
, andz
as props.additionalSolverIterations
tomutableRigidBodyOptions
erp
andpredictionDistance
to0.8
and0.002
, respectfully.erp
to0.2
. Inside of rapier.js, the default value is0.2
, as shown here.Changes
<Physics />
to reflect tointegrationParameters
for@dimforge/rapier3d-compat
v0.12.0useSpringJoint
anduseRopeJoint
started by @isaac-masonbodyAnchor
s is significant<SpringExample />
and<RopeJointExample />
examplesvector3ToRapierVector
utility functionbodyAnchor
types to react-three/fiber'sVector3
.Vector3
,Vector3Tuple
, or anumber
.Vector3
so we do not unnecessarily create threejsVector3
classes.Checklist: