-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Increase WorldBoundaryShape3D size to 8192x8192 when using Jolt #101130
base: master
Are you sure you want to change the base?
Increase WorldBoundaryShape3D size to 8192x8192 when using Jolt #101130
Conversation
Unlike GodotPhysics, WorldBoundaryShape3D has a finite size in Jolt Physics. This increases the default size to suit most projects using single-precision builds.
I think this is a risky change. When a rigid body falls onto the world boundary shape, the collision detection algorithm will request the faces of both colliding shapes and then clip them against each other in order to get the contact manifold (of up to 4 contact points). I would prefer the current lower default value. |
Ah, I was under the impression (from this discussion) that this would largely only become relevant with I guess it might also be worth mentioning that the plan/hope is for this limit to not be a project setting eventually, but instead a property on |
I made a test project with a few RigidBodies3D laying on a WorldBoundaryShape3D: test-worldboundaryshape3d.zip Move using WASD and make the shapes jump by pressing Space. Even if increase the shape size limit to Note that regardless of the shape size limit used, the rigid bodies will momentarily penetrate the WorldBoundaryShape3D when landing then move back up slowly. This issue isn't present on GodotPhysics3D. I assume this is due to Jolt using GJK-EPA instead of an exact approach like GodotPhysics3D, but I wonder if there are any mitigations for it (e.g. on the camera side, for first-person characters). shapes_move_back_up_slowly.mp4It may be easier to notice the issue when watching in slow motion (right-click the video and choose a playback speed). |
The penetration is something that happens with Godot Physics as well, so long as you're not using CCD. You can just barely see the correction as a quick judder, as opposed to Jolt's slower correction. That slower correction is (as I understand it) largely due to Jolt's use of Baumgarte stabilization, which makes the contact constraints a bit more "springy" to help with simulation stability. You can lessen this effect by either upping the To prevent most of the penetration in the first place, you might instead want to enable CCD on the bodies, and lower the |
Unlike GodotPhysics, WorldBoundaryShape3D has a finite size in Jolt Physics.
This increases the default size to suit most projects using single-precision builds. As per the Large world coordinates documentation, it's recommended to keep all gameplay within a 8192x8192x8192 area centered around the world origin, so the new default covers that. The precision is halved when going past every power of 2 value, which is why the new default is also a power of 2.
The size isn't currently overridden when using a double-precision build (this could be done using the
double
feature tag), but from what @mihe told me, Jolt doesn't use double precision in the same ways GodotPhysics does. It's only used for absolute positions, not relative coordinates such as velocity, so it needs further testing to see if huge WorldBoundaryShape3D sizes like2^32
work correctly in double precision builds.cc @jrouwe