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 and rules governing the physics simulation for the body.
Usage
To access the physics world of a PhysicsBody
, simply use the World
property. This can be useful for operations that require knowledge of the entire physics environment, such as querying for other bodies or understanding the global physics settings.
Example
// Example of accessing the PhysicsWorld from a PhysicsBody
PhysicsBody myBody = new PhysicsBody();
PhysicsWorld myWorld = myBody.World;
// Use the PhysicsWorld to perform operations
// For example, checking gravity settings
Vector3 gravity = myWorld.Gravity;