void Delete()

robot_2Generated
code_blocksInput

Description

The Delete method is used to remove a PhysicsWorld instance and all the objects contained 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 deletion of essential physics worlds that are automatically managed by the system.

Usage

To use the Delete method, ensure that you have a reference to a PhysicsWorld instance that you have created manually. Call the Delete method on this instance when you want to remove the world and all its associated objects from the simulation.

Example

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

// Perform operations with myWorld

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