Interface WorldPhysicsOptions

For configuring the properties of a World (matter.js) Refer to matter.js documentation

WorldPhysicsOptions

interface WorldPhysicsOptions {
    constraintIterations?: number;
    detector?: any;
    enableSleeping?: boolean;
    gravity?: Gravity;
    plugin?: any;
    positionIterations?: number;
    timing?: PhysicsTimingOptions;
    velocityIterations?: number;
    world?: Object;
}

Properties

constraintIterations?: number

An integer Number that specifies the number of constraint iterations to perform each update. The higher the value, the higher quality the simulation will be at the expense of performance. The default value of 2 is usually very adequate.

detector?: any

A Matter.Detector instance, default is Matter.Detector

enableSleeping?: boolean

A flag that specifies whether the engine should allow sleeping via the Matter.Sleeping module. Sleeping can improve stability and performance, but often at the expense of accuracy. default is false

gravity?: Gravity

An optional gravitational acceleration applied to all bodies in engine.world on every update. default is { x: 0, y: 1, scale: 0.001 }

plugin?: any

An object reserved for storing plugin-specific properties.

positionIterations?: number

An integer Number that specifies the number of position iterations to perform each update. The higher the value, the higher quality the simulation will be at the expense of performance. The default value is 6

An object that specifies the timing systems to use for engine updates and rendering. default is { lastDelta: 1000 / 60, lastElapsed: 1000 / 60, timeScale: 1, timestamp: 0 }

velocityIterations?: number

An integer Number that specifies the number of velocity iterations to perform each update. The higher the value, the higher quality the simulation will be at the expense of performance.

world?: Object

The root Matter.Composite instance that will contain all bodies, constraints and other composites to be simulated by this engine. default is a Matter.Composite with no bodies (Handled under the hood, do not worry about this)

Generated using TypeDoc