The World
property of the PhysicsGroup
class represents the PhysicsWorld
instance to which this group of physics bodies belongs. This property provides access to the broader physics simulation environment that the group is part of.
The World
property of the PhysicsGroup
class represents the PhysicsWorld
instance to which this group of physics bodies belongs. This property provides access to the broader physics simulation environment that the group is part of.
Use the World
property to access the physics world associated with a specific PhysicsGroup
. This can be useful for operations that require context about the entire physics simulation, such as querying global physics settings or interacting with other physics groups within the same world.
// Example of accessing the World property PhysicsGroup myPhysicsGroup = new PhysicsGroup(); PhysicsWorld world = myPhysicsGroup.World; // Use the world object to perform operations // For example, you might want to check the gravity settings Vector3 gravity = world.Gravity; // Or interact with other physics groups in the same world foreach (var group in world.Groups) { // Perform operations with each group }