Can someone explain to me the difference between PhysicsWorld, CollisionWorld, and DynamicsWorld?
What is the purpose of these worlds?
DynamicsWorld holds only the data related to movement of bodies, so it’s the only thing the physics solver accesses. CollisionWorld holds the body collision data and can actually be used even without a full physics step because it encapsulates logic for collision and finding overlapping bodies, as well as queries. Finally, PhysicsWorld is a collection of one DynamicsWorld and one CollisionWorld and presents a full physics solution. It’s just the way how data is laid out. You are never expected to use the DynamicsWorld on its own, so either use PhysicsWorld if you need a full physics step, or just CollisionWorld if you’re only into queries.
5 Likes