The C++ extension should not have a global variable s_valid_bodies. Instead, each instance of the world should have its own collection variable. Same applies to joints. Additionally, all the collection getter functions should be within the scope of their associated world rather than global.
The C++ extension should not have a global variable s_valid_bodies. Instead, each instance of the world should have its own collection variable. Same applies to joints. Additionally, all the collection getter functions should be within the scope of their associated world rather than global.