Question regarding inMaxBodies when initializing the PhysicsSystem #917
-
I noticed some weird behavior, and realized it was occurring because my max bodies was only set to 1,024. I have since increased it to 65535 as suggested in the comments. I am wondering what are the implications of increasing the number here? I see that there is a vector that gets reserved for the bodies in the body manager as well as two arrays get allocated for rigid and soft bodies in the body manager. If I am to increase the number of max bodies, is there any performance impact or is it only just resulting in more memory being allocated? Also, is there any way to adjust the parameters after the physics system has been initialized or does it need to be completely shut down and reinitialized to do so? As always thank you very much! I'm loving Jolt so far. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Costs more memory (but not a lot).
It needs to be shut down completely. The reason for preallocating all of this is that Jolt allows multi-threaded access to many of its structures, reallocating would break this.
Yes it can, the IslandBuilder only uses temporary allocations that are freed every frame. It doesn't need a destructor. |
Beta Was this translation helpful? Give feedback.
Costs more memory (but not a lot).
It needs to be shut down completely. The reason for preallocating all of this is that Jolt allows multi-threaded access to many of its structures, reallocating would break this.
Yes it can, the IslandBuilder only uses temporary allocations that are …