Class PhysicsStepSettings
Configuration for fixed-timestep simulation stepping used by PhysicsWorld2D.
public sealed record PhysicsStepSettings : IEquatable<PhysicsStepSettings>
- Inheritance
-
PhysicsStepSettings
- Implements
Constructors
PhysicsStepSettings(int, int, int, float, int)
Configuration for fixed-timestep simulation stepping used by PhysicsWorld2D.
public PhysicsStepSettings(int TargetHz = 60, int MaxStepsPerFrame = 3, int SubStepCount = 4, float TimeScale = 1, int WorkerCount = 0)
Parameters
TargetHzintTarget simulation frequency in hertz; the fixed step size is derived from it.
MaxStepsPerFrameintMaximum number of fixed steps processed per frame, to avoid the spiral of death.
SubStepCountintBox2D sub-step count passed to each world step.
TimeScalefloatMultiplier applied to incoming delta time before fixed-step accumulation.
WorkerCountintNumber of solver worker threads, fixed when the world is created. 0 (the default) resolves to min(8, processor count / 2), the Box2D samples' convention; 1 steps single-threaded. Box2D is deterministic across worker counts.
Properties
FixedDeltaSeconds
Duration of one fixed step in seconds (derived from TargetHz).
public float FixedDeltaSeconds { get; }
Property Value
MaxStepsPerFrame
Maximum number of fixed steps processed per frame, to avoid the spiral of death.
public int MaxStepsPerFrame { get; init; }
Property Value
SubStepCount
Box2D sub-step count passed to each world step.
public int SubStepCount { get; init; }
Property Value
TargetHz
Target simulation frequency in hertz; the fixed step size is derived from it.
public int TargetHz { get; init; }
Property Value
TimeScale
Multiplier applied to incoming delta time before fixed-step accumulation.
public float TimeScale { get; init; }
Property Value
WorkerCount
Number of solver worker threads, fixed when the world is created. 0 (the default) resolves to min(8, processor count / 2), the Box2D samples' convention; 1 steps single-threaded. Box2D is deterministic across worker counts.
public int WorkerCount { get; init; }