fix(physics): Jolt's own pair and contact limits (65536 / 20480) rather than the body count's, and a temporary allocator that falls back to the heap - a valley of 60,000 still trunks aborted its first step with a moving body in it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-27 02:02:56 +03:00
parent 510360b002
commit 3fae64f975
2 changed files with 8 additions and 5 deletions

Binary file not shown.

View file

@ -90,12 +90,15 @@ public:
};
struct World {
// pairs and contacts are for what MOVES: a valley of sixty thousand still trunks makes none
// between them, so these are Jolt's own sizes, not the body count's; the temporary memory falls
// back to the heap rather than aborting a step
World(int max_bodies, int threads)
: temp(16 * 1024 * 1024), jobs(cMaxPhysicsJobs, cMaxPhysicsBarriers, threads) {
sys.Init(max_bodies, 0, max_bodies, max_bodies * 4, bpl, ovb, olp);
: temp(32 * 1024 * 1024), jobs(cMaxPhysicsJobs, cMaxPhysicsBarriers, threads) {
sys.Init(max_bodies, 0, 65536, 20480, bpl, ovb, olp);
sys.SetContactListener(&contacts);
}
TempAllocatorImpl temp;
TempAllocatorImplWithMallocFallback temp;
JobSystemThreadPool jobs;
BPLayers bpl;
ObjVsBP ovb;