Skip to main content

Function: addPhysicsBodyComponent()

addPhysicsBodyComponent(world, entity, options): PhysicsBodyEcsComponent

Defined in: physics/components/physics-body-component.ts:56

Attaches a PhysicsBodyEcsComponent to entity.

Parameters

world

EcsWorld

The ECS world entity belongs to.

entity

number

The entity to attach the component to.

options

PhysicsBodyEcsComponent

Options for configuring the physics body. physicsBody has no sensible default and must always be provided.

Returns

PhysicsBodyEcsComponent

The attached component, for further tuning or runtime changes.