You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Physics3D: contact-constraint overflow at ~10k bodies makes objects tunnel through static geometry; JoltScene ignores PhysicsSettings limits #523
Is your feature request related to a problem? Please describe.
At ~10 000 contacting dynamic bodies, Jolt's contact-constraint buffer overflows and bodies silently tunnel through static geometry. The perf stress battery's physics_pile_10000 scene (10k boxes/spheres falling into a walled arena) spams
[error] OloEngine: Jolt physics update error: 4
(4 = EPhysicsUpdateError::ContactConstraintsFull — "Some contacts were ignored. Increase inMaxContactConstraints") and the battery's workload probe caught a body at y = −36 and still falling after 20 s — through the arena's static floor (its collider was valid; the 1k variant of the same scene settles correctly at y ≈ 0.5).
Two config problems compound it:
JoltScene.h hardcodes s_MaxContactConstraints = 10240 (and s_MaxBodies/s_MaxBodyPairs = 65536) as constexpr, so a project cannot raise it.
PhysicsSettings::m_MaxContactConstraints (PhysicsSettings.h:28) exists and is honoured by Physics3DSystem::Init — but JoltScene::Init (JoltScene.cpp:2383) uses its own constants and ignores the settings. The two init paths disagree.
Describe the solution you'd like
Route JoltScene init through PhysicsSettings (one source of truth), with defaults sized for the advertised body counts (10240 constraints is far too small for 65536 max bodies).
Surface the overflow loudly but throttled (see the FrameDataBuffer log-spam issue): today it's an every-step error line, and the gameplay symptom (objects falling through the world) is disconnected from the cause.
Describe alternatives you've considered
Documenting a practical body-count ceiling instead — but 10k dynamic bodies is within Jolt's comfortable range when the buffers are sized for it; the engine shouldn't corrupt the simulation silently.
Additional context
From the perf stress battery (generate_perf_scenes.py --scene physics_pile --count 10000, Dist). At 50k bodies MaxBodies (65536) still fits, but the same overflow applies. Frame cost at 10k was ~1.6 s/frame in Dist (fixed-timestep catch-up spiral) — separate scalability data in the battery findings report.
Activity
coderabbitai commentedon Jul 3, 2026
🔗 Related PRs
#78 - Feature/physics integration [closed]
#305 - ci(physics): retry flaky PhysicsLayerFilteringTest + harden JoltJobSy… [merged]
#323 - feat(physics): springy (soft) hinge/slider joint limits via SpringSet… [merged]
#340 - feat(physics): add CollideConnected toggle for joints (
#308item 1) [merged]#468 - feat(physics): wire Jolt HeightFieldShape into terrain collision (
#428) [merged]🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!