Table of Contents

Struct b3WorldDef

Namespace
Box3D.Native
Assembly
Box3D.NET.Native.dll

The definition used to create a simulation world. Mirror of b3WorldDef.

public struct b3WorldDef

Inherited Members

Examples

b3WorldDef def = B3.b3DefaultWorldDef();
def.gravity = new Vector3(0.0f, -9.8f, 0.0f);
b3WorldId world = B3.b3CreateWorld(in def);

Remarks

Always start from B3.b3DefaultWorldDef(). The structure carries an Box3D.Native.b3WorldDef.internalValue that Box3D uses to reject definitions that were not initialized, so a zero-initialized instance will be refused.

Fields

capacity

Optional initial capacities.

contactDampingRatio

The contact damping ratio. Non-dimensional.

contactHertz

The contact stiffness in cycles per second.

contactSpeed

The cap on the overlap resolution speed, usually in metres per second.

createDebugShape

The callback that creates a debug draw shape, invoked the first time a shape is drawn.

destroyDebugShape

The callback that destroys a debug draw shape when the shape is modified or destroyed.

enableContinuous

Whether continuous collision is enabled.

enableSleep

Whether bodies may sleep.

enqueueTask

The callback that spawns a task.

finishTask

The callback that waits for a task to finish. It must block until the task has completed.

frictionCallback

An optional callback mixing the friction of two surfaces. The default is sqrt(frictionA * frictionB).

gravity

The gravity vector. Box3D defines no up axis of its own.

hitEventThreshold

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

internalValue

Used internally to detect a valid definition. Do not set.

maximumLinearSpeed

The maximum linear speed, usually in metres per second.

restitutionCallback

An optional callback mixing the restitution of two surfaces. The default is max(restitutionA, restitutionB).

restitutionThreshold

The speed above which collisions bounce, usually in metres per second.

userData

Application data associated with the world.

userDebugShapeContext

The context passed to the debug shape callbacks.

userTaskContext

The context passed to Box3D.Native.b3WorldDef.enqueueTask and Box3D.Native.b3WorldDef.finishTask.

workerCount

The number of workers to use, clamped to one through Box3D.Native.Constants.B3_MAX_WORKERS.