Skip to content

eulerjs API / @eulerjs/core / Behavior

Behavior ​

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

Per-body extension, e.g. buoyancy or a sail. Runs every fixed step while the body is in a world.

Methods ​

attach()? ​

ts
optional attach(body): void;

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

Called by body.addBehavior(behavior).

Parameters ​

ParameterType
bodyBody

Returns ​

void


detach()? ​

ts
optional detach(body): void;

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

Called by body.removeBehavior(behavior).

Parameters ​

ParameterType
bodyBody

Returns ​

void


fixedUpdate() ​

ts
fixedUpdate(
   body, 
   timestep, 
   world
): void;

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

Parameters ​

ParameterType
bodyBody
timestepnumber
worldWorld

Returns ​

void

Released under the MIT License.