PhysicsWorld World { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The World property of a PhysicsBody object provides access to the PhysicsWorld that the body is part of. This property is essential for understanding the context in which the physics body operates, as it defines the environment's physical rules and interactions.

Usage

Use the World property to retrieve the PhysicsWorld instance associated with a PhysicsBody. This can be useful for operations that require knowledge of the broader physics environment, such as querying global physics settings or interacting with other physics bodies within the same world.

Example

PhysicsBody myBody = new PhysicsBody();
PhysicsWorld world = myBody.World;

// Use the world to perform operations or queries
Vector3 gravity = world.Gravity;
Console.WriteLine($"The gravity in this world is: {gravity}");