Table of Contents

Struct WorldSettings

Namespace
Box3D
Assembly
Box3D.NET.dll

The tuning applied to a Box3D.PhysicsWorld when it is created.

public readonly record struct WorldSettings : IEquatable<WorldSettings>

Implements

Inherited Members

Examples

var settings = WorldSettings.Default with
{
    Gravity = new Vector3(0.0f, -9.81f, 0.0f),
    WorkerCount = Environment.ProcessorCount / 2,
};

using var world = new PhysicsWorld(settings);

Remarks

Start from Box3D.WorldSettings.Default, whose values come from the engine, and change only what you need. Most simulations only ever set Box3D.WorldSettings.Gravity and Box3D.WorldSettings.WorkerCount.

Properties

ContactDampingRatio

Gets the contact damping ratio.

ContactHertz

Gets the contact stiffness, in cycles per second.

ContactSpeed

Gets the cap on how fast overlap is pushed apart, usually in metres per second.

Default

Gets the engine's default settings.

EnableContinuous

Gets a value indicating whether continuous collision is enabled, which stops fast bodies tunnelling through thin geometry.

EnableSleep

Gets a value indicating whether bodies may sleep when they stop moving.

Gravity

Gets the gravity vector, usually in metres per second squared.

HitEventThreshold

Gets the approach speed above which a collision can raise a hit event, usually in metres per second.

MaxWorkerCount

Gets the largest value Box3D.WorldSettings.WorkerCount may take.

MaximumLinearSpeed

Gets the maximum linear speed any body may reach, usually in metres per second.

RestitutionThreshold

Gets the approach speed above which collisions bounce, usually in metres per second.

WorkerCount

Gets the number of worker threads, clamped to one through Box3D.WorldSettings.MaxWorkerCount.