Skip to content

eulerjs API / @eulerjs/core / Plugin

Plugin ​

Defined in: packages/core/src/plugins.ts:8

World-level extension. Every hook is optional and runs once per fixed step, in this order: beforeStep, then every body's behaviours, then applyForces, then the backend simulates, then afterStep.

Properties ​

PropertyModifierTypeDefined in
namereadonlystringpackages/core/src/plugins.ts:9

Methods ​

afterStep()? ​

ts
optional afterStep(world, timestep): void;

Defined in: packages/core/src/plugins.ts:15

Parameters ​

ParameterType
worldWorld
timestepnumber

Returns ​

void


applyForces()? ​

ts
optional applyForces(world, timestep): void;

Defined in: packages/core/src/plugins.ts:14

Add forces to bodies here; the backend simulates them right after.

Parameters ​

ParameterType
worldWorld
timestepnumber

Returns ​

void


beforeStep()? ​

ts
optional beforeStep(world, timestep): void;

Defined in: packages/core/src/plugins.ts:12

Parameters ​

ParameterType
worldWorld
timestepnumber

Returns ​

void


dispose()? ​

ts
optional dispose(world): void;

Defined in: packages/core/src/plugins.ts:17

Called by world.removePlugin(plugin) and world.dispose().

Parameters ​

ParameterType
worldWorld

Returns ​

void


install()? ​

ts
optional install(world): void;

Defined in: packages/core/src/plugins.ts:11

Called once by world.use(plugin).

Parameters ​

ParameterType
worldWorld

Returns ​

void

Released under the MIT License.