void Delete()

book_4_sparkGenerated
code_blocksInput

Description

The Delete method is used to remove the current PhysicsWorld instance and all associated objects within it. This operation is irreversible and will throw an exception if you attempt to delete a world that was not manually created by you. This ensures that only user-created worlds can be deleted, preventing accidental removal of essential physics worlds that are automatically managed by the system.

Usage

To use the Delete method, ensure that the PhysicsWorld instance you are working with was manually created. Attempting to delete a system-managed world will result in an exception. This method is typically used when you need to clean up resources or reset the physics environment in a controlled manner.

Example

// Example of creating and deleting a PhysicsWorld
PhysicsWorld myWorld = new PhysicsWorld();

// Perform operations with myWorld

// When done, delete the world
myWorld.Delete();