PhysicsWorld World { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

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.

Usage

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

// 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
}