godotengine / godotengine/godot

Jolt: Body penetration issues compared to GodotPhysics3D

Open
#101,149 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion topic:3d topic:physics
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

Tested versions
  • Reproducible in: v4.4.dev7.official [46c8f8c5c]
System information

Godot v4.4.dev7 - Windows 11 (build 26100) - Multi-window, 1 monitor - OpenGL 3 (Compatibility) - NVIDIA GeForce RTX 4060 Ti (NVIDIA; 32.0.15.6636) - 11th Gen Intel(R) Core(TM) i5-11400F @ 2.60GHz (12 threads)

Issue description

Compared to GodotPhysics3D, Jolt seems to exhibit object penetration issues, which can go up to 0.05m and does not depenetrate until the velocity becomes a very low amount, which is enough to cause a collision as demonstrated here.

Jolt Physics on Default Settings;
https://github.com/user-attachments/assets/d7d9a2b4-9631-4569-9f20-7f699399f5c9

GodotPhysics3D on Default Settings:
https://github.com/user-attachments/assets/dcd5b799-4a4e-4c51-962c-38f0ccbd2d72

These settings do not seem to change anything about the simulation, the ball is still ~0.05m inside the box which causes it to bump on the ramp:
physics/jolt_physics_3d/simulation/velocity_steps
physics/jolt_physics_3d/simulation/position_steps
physics/jolt_physics_3d/simulation/penetration_slop
physics/jolt_physics_3d/simulation/baumgarte_stabilization_factor
Everything under physics/3d/solver (although I'm guessing these are GodotPhysics3D only parameters).

Setting Continuous CD on the Rigidbody does not change anything, and neither does changing any of CD settings under Jolt settings.

The ONLY setting that seems to affect anything is physics/jolt_physics_3d/simulation/speculative_contact_distance, setting it to 0.07 fixes the issue at this velocity, setting linear_velocity to -100 or -200 in the rigidbody settings, will once again cause it to penetrate and stick to the floor and bump when touching the ramp. Also the documentation of the parameters mentions increasing it may cause ghost collision, so I'm scared to increase it too much cause my last attempt at a game reliant on RigidBodies suffered a lot from those.

Steps to reproduce

The MRP includes the setup shown in the videos, it reliably does the bump on default settings on my end. It was changed slightly to make it so the ball should be on Y 0.0 when reaching the floor, which I only thought of after recording.
It's set up in a way that allows frame stepping.

Minimal reproduction project (MRP)

joltpenetrationmrp.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use joltpenetrationmrp.zip to reproduce the bump with frame stepping on the reported Godot 4.4.dev7 setup. Compare Jolt Physics on default settings with GodotPhysics3D, then test the listed Jolt simulation and continuous-CD settings. Done means the penetration and resulting ramp collision are corrected without relying on an excessive speculative_contact_distance.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.