Julio Jerez wrote:I find that too cumbersome.
It's not your responsibility at all, if you make it an option so your users can handle it on their side.
I'll look at the free list approach, but i guess it's not what i want, because it's still unique objects then.
I'll give an example of what i want:
Game is like GTA. As the player moves around, close up pedestrians and cars switch from animation to simulation.
That means we have to create lots of bodies and joints constantly during gameplay, and initialization becomes a performance problem.
To solve this, we could eventually use big character and vehicle structs which contain all bodies and joints for an instance of the generic model. Because our game is mostly about people and cars, those two structs would already handle most cases, and we might not need to use individual pools for each type of joints and bodies.
To initialize a new character, we only need to get one free block form the pool, loop over bodies and joints to initialize, finally give Newton pointers to the stuff.
If we remove it, We inform Newton to remove the stuff from simulation, and care about deallocation again on our side.
Wouldn't that be nice, and actually little work for you to support?
I declare this my biggest request, followed by scrolling open world support (which ofc. is serious work).
Afaik, the quick add/removal problem was the primary reason why the new Horizon Zero Dawn game uses a hobby physics engine of one of its employees, 'Jolt'. It's on Github, maybe worth a look.
Btw, my experience with 4 is pretty good so far. Finding functionality is harder now, missing the C API, but otherwise everything is easier and more efficient.