An instance of a broadphase controller. The default value is a Matter.Grid instance created by Engine.create.
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.
A flag that specifies whether the engine is running or not.
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.
Collision pair set for this Engine.
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.
An Object containing properties regarding the timing systems of the engine.
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.
A World composite object that will contain all simulated bodies and constraints.
StaticclearStaticcreateCreates a new engine. The options parameter is an object that specifies any properties you wish to override the defaults.
All properties have default values, and many are pre-calculated automatically based on other properties.
See the properties section below for detailed information on what you can pass via the options object.
Optionalelement: MatterJS.IEngineDefinition | HTMLElementOptionaloptions: MatterJS.IEngineDefinitionengine
Creates a new engine. The options parameter is an object that specifies any properties you wish to override the defaults.
All properties have default values, and many are pre-calculated automatically based on other properties.
See the properties section below for detailed information on what you can pass via the options object.
Optionaloptions: MatterJS.IEngineDefinitionengine
StaticmergeStaticrunStaticupdate
The
Matter.Enginemodule contains methods for creating and manipulating engines. An engine is a controller that manages updating the simulation of the world. SeeMatter.Runnerfor an optional game loop utility.See the included usage examples.
Engine