int SubSteps { get; set; }

robot_2Generated
code_blocksInput

Description

The SubSteps property of the PhysicsWorld class allows you to control the number of substeps that the physics engine performs per tick. This can be useful if you are experiencing issues with objects passing through each other or if you have a low tickrate. By increasing the number of substeps, you can achieve more accurate physics simulations.

The default value for SubSteps is 1, which generally provides good performance and accuracy. However, if you increase this value, be aware that the number of physics ticks per second will be the product of the tickrate and the number of substeps. For example, if your tickrate is 90 and you set SubSteps to 1000, the engine will perform 90,000 steps per second, which can significantly impact performance.

Usage

To adjust the number of physics substeps in your PhysicsWorld, simply set the SubSteps property to the desired integer value. Be cautious when increasing this value, as it can lead to a high number of physics calculations per second, potentially affecting performance.

Example usage:

PhysicsWorld world = new PhysicsWorld();
world.SubSteps = 10; // Increase substeps for more accurate physics

Example

PhysicsWorld world = new PhysicsWorld();
world.SubSteps = 10; // Increase substeps for more accurate physics