book_4_sparkGenerated
code_blocksInput

Description

The Discrete field is a member of the PhysicsSimulationMode enumeration within the Sandbox namespace. It represents a mode of physics simulation where collision detection is performed in a discrete manner. This means that physics bodies may pass through thin walls if they are moving at high speeds, due to the nature of discrete collision checks. However, this mode offers better performance compared to continuous collision detection.

Usage

Use the Discrete mode when performance is a priority and the simulation does not require precise collision detection for fast-moving objects. This mode is suitable for scenarios where occasional tunneling through thin objects is acceptable.

Example

// Example of setting the physics simulation mode to Discrete
PhysicsWorld world = new PhysicsWorld();
world.SimulationMode = PhysicsSimulationMode.Discrete;