-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Expose joint damping_ratio and natural_frequency per joint to make joints soft #231
Comments
I noticed the range sliders only go from 0 to 10, but started at some huge amount. I guess enter by hand is the key. |
I can update the range sliders limit, maybe I set it from 0 to 10 by copy pasting other properties. But in any case, this is how most likely softness will be done in godot-rapier. If you want to test it for now until it's done per joint, you can give it a try see if you like it. Another way to make it more reactive is to try: Also mass has some importance I think. |
The units are 100, that is how many pixels equal 1 meter. It affects some things, unsure if it affects linear velocity though. |
I will test things and scale as needed. I'll probably have to scale up things a bit, if the mass is accurately in kilograms then things should be okay as long as I can stick to the scale, but the lack of z dimension probably leaves room for arbitrary approximations. Damage on impact is calculated with velocity, though the linear_velocity is always what it is the frame after the collision, so I have to grab it on the physics frame just before (another one of Godot's wacky things) . As is it's pixels per second, or if I do it by position each frame manually, pixels per frame. I was going for 128 p/meter so not far off, just to stick with general texture standard powers of 2. |
There have been 2 issues about PinJoint2D not having softness like Godot has. Rapier just doesn't support per joint softness, so as a workaround you can change the following project wide properties:
physics/rapier/joint/damping_ratio
physics/rapier/joint/natural_frequency
These will help to make soft joints (eg damping ratio 0.1 and natural_frequency 50).
However, there isn't a way right now in rapier to set these per joint. Here is linked issue in Rapier dimforge/rapier#676
Also, in order to expose new properties (on the joint directly) and hide the softness, this one needs to be solved first: godotengine/godot-proposals#10438 (comment)
The text was updated successfully, but these errors were encountered: