Skip to content

MatterPhysics

Extends

Constructors

new MatterPhysics()

new MatterPhysics(app): MatterPhysics

Parameters

app: Application<any>

Returns

MatterPhysics

Overrides

PhysicsBase.constructor

Source

src/physics/matter/MatterPhysics.ts:15

Properties

_factory

_factory: IPhysicsFactory

Inherited from

PhysicsBase._factory

Source

src/physics/PhysicsBase.ts:7

Accessors

add

get add(): IPhysicsAddFactory

Returns

IPhysicsAddFactory

Source

src/physics/PhysicsBase.ts:40


container

set container(value): void

Parameters

value: Container<Application<any>>

Source

src/physics/PhysicsBase.ts:44


debug

get debug(): boolean

set debug(value): void

Parameters

value: boolean

Returns

boolean

Source

src/physics/PhysicsBase.ts:36


engine

get engine(): Engine

Returns

Engine

Source

src/physics/matter/MatterPhysics.ts:20


factory

get factory(): IPhysicsFactory

Returns

IPhysicsFactory

Source

src/physics/PhysicsBase.ts:15

Methods

addToWorld()

addToWorld(…objects): void

Parameters

• …objects: (MatterBodyLike | IMatterPhysicsObject)[]

Returns

void

Overrides

PhysicsBase.addToWorld

Source

src/physics/matter/MatterPhysics.ts:93


createWorldBounds()

createWorldBounds(useStage): void

Parameters

useStage: boolean= true

Returns

void

Source

src/physics/matter/MatterPhysics.ts:56


destroy()

destroy(): void

Returns

void

Overrides

PhysicsBase.destroy

Source

src/physics/matter/MatterPhysics.ts:24


drawDebug()

drawDebug(): void

Returns

void

Source

src/physics/matter/MatterPhysics.ts:113


init()

init(pAutoStart, pDebug, autoCreateBounds, pEngineOptions): Promise<void>

Initializes the physics engine

Parameters

pAutoStart: boolean= false

pDebug: boolean= false

autoCreateBounds: boolean= true

pEngineOptions: IEngineDefinition= {}

Returns

Promise<void>

Overrides

PhysicsBase.init

Source

src/physics/matter/MatterPhysics.ts:32


removeFromWorld()

removeFromWorld(…bodies): void

Parameters

• …bodies: MatterBodyLike[]

Returns

void

Overrides

PhysicsBase.removeFromWorld

Source

src/physics/matter/MatterPhysics.ts:107


start()

start(): void

Returns

void

Source

src/physics/matter/MatterPhysics.ts:85


stop()

stop(): void

Returns

void

Source

src/physics/matter/MatterPhysics.ts:89


update()

update(_deltaTime): void

Parameters

_deltaTime: number

Returns

void

Overrides

PhysicsBase.update

Source

src/physics/matter/MatterPhysics.ts:135