Table of Contents

Class PhysicsStepSettings

Namespace
Stride.CommunityToolkit.Box2D
Assembly
Stride.CommunityToolkit.Box2D.dll

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

TargetHz int

Target simulation frequency in hertz; the fixed step size is derived from it.

MaxStepsPerFrame int

Maximum number of fixed steps processed per frame, to avoid the spiral of death.

SubStepCount int

Box2D sub-step count passed to each world step.

TimeScale float

Multiplier applied to incoming delta time before fixed-step accumulation.

WorkerCount int

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.

Properties

FixedDeltaSeconds

Duration of one fixed step in seconds (derived from TargetHz).

public float FixedDeltaSeconds { get; }

Property Value

float

MaxStepsPerFrame

Maximum number of fixed steps processed per frame, to avoid the spiral of death.

public int MaxStepsPerFrame { get; init; }

Property Value

int

SubStepCount

Box2D sub-step count passed to each world step.

public int SubStepCount { get; init; }

Property Value

int

TargetHz

Target simulation frequency in hertz; the fixed step size is derived from it.

public int TargetHz { get; init; }

Property Value

int

TimeScale

Multiplier applied to incoming delta time before fixed-step accumulation.

public float TimeScale { get; init; }

Property Value

float

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; }

Property Value

int