Class: MatterPhysics

Phaser.Physics.Matter. MatterPhysics

[description]


new MatterPhysics(scene)

Parameters:
Name Type Description
scene Phaser.Scene

[description]

Since: 3.0.0
Source: src/physics/matter-js/MatterPhysics.js (Line 20)

Members


add :Phaser.Physics.Matter.Factory

[description]

Type:
Since: 3.0.0
Source: src/physics/matter-js/MatterPhysics.js (Line 73)

config :object

[description]

Type:
  • object
Since: 3.0.0
Source: src/physics/matter-js/MatterPhysics.js (Line 55)

scene :Phaser.Scene

[description]

Type:
Since: 3.0.0
Source: src/physics/matter-js/MatterPhysics.js (Line 37)

systems :Phaser.Scenes.Systems

[description]

Type:
Since: 3.0.0
Source: src/physics/matter-js/MatterPhysics.js (Line 46)

verts :MatterJS.Vertices

A reference to the Matter.Vertices module which contains methods for creating and manipulating sets of vertices.
A set of vertices is an array of Matter.Vector with additional indexing properties inserted by Vertices.create.
A Matter.Body maintains a set of vertices to represent the shape of the object (its convex hull).

Type:
Since: 3.14.0
Source: src/physics/matter-js/MatterPhysics.js (Line 82)

world :Phaser.Physics.Matter.World

[description]

Type:
Since: 3.0.0
Source: src/physics/matter-js/MatterPhysics.js (Line 64)

Methods


enableAttractorPlugin()

[description]

Since: 3.0.0
Source: src/physics/matter-js/MatterPhysics.js (Line 172)
Returns:

This Matter Physics instance.

Type
Phaser.Physics.Matter.MatterPhysics

enableWrapPlugin()

[description]

Since: 3.0.0
Source: src/physics/matter-js/MatterPhysics.js (Line 188)
Returns:

This Matter Physics instance.

Type
Phaser.Physics.Matter.MatterPhysics

getConfig()

[description]

Since: 3.0.0
Source: src/physics/matter-js/MatterPhysics.js (Line 151)
Returns:

[description]

Type
object

pause()

[description]

Since: 3.0.0
Source: src/physics/matter-js/MatterPhysics.js (Line 204)
Returns:

The Matter World object.

Type
Phaser.Physics.Matter.World

resume()

[description]

Since: 3.0.0
Source: src/physics/matter-js/MatterPhysics.js (Line 217)
Returns:

The Matter World object.

Type
Phaser.Physics.Matter.World

set30Hz()

Sets the Matter Engine to run at fixed timestep of 30Hz and enables autoUpdate.
If you have set a custom getDelta function then this will override it.

Since: 3.4.0
Source: src/physics/matter-js/MatterPhysics.js (Line 247)
Returns:

This Matter Physics instance.

Type
Phaser.Physics.Matter.MatterPhysics

set60Hz()

Sets the Matter Engine to run at fixed timestep of 60Hz and enables autoUpdate.
If you have set a custom getDelta function then this will override it.

Since: 3.4.0
Source: src/physics/matter-js/MatterPhysics.js (Line 230)
Returns:

This Matter Physics instance.

Type
Phaser.Physics.Matter.MatterPhysics

step( [delta] [, correction])

Manually advances the physics simulation by one iteration.

You can optionally pass in the delta and correction values to be used by Engine.update.
If undefined they use the Matter defaults of 60Hz and no correction.

Calling step directly bypasses any checks of enabled or autoUpdate.

It also ignores any custom getDelta functions, as you should be passing the delta
value in to this call.

You can adjust the number of iterations that Engine.update performs internally.
Use the Scene Matter Physics config object to set the following properties:

positionIterations (defaults to 6)
velocityIterations (defaults to 4)
constraintIterations (defaults to 2)

Adjusting these values can help performance in certain situations, depending on the physics requirements
of your game.

Parameters:
Name Type Argument Default Description
delta number <optional>
16.666

[description]

correction number <optional>
1

[description]

Since: 3.4.0
Source: src/physics/matter-js/MatterPhysics.js (Line 264)