Skip to main content

Function: addLinearDamperComponent()

addLinearDamperComponent(world, entity, options): LinearDamperEcsComponent

Defined in: physics/components/linear-damper-component.ts:79

Attaches a LinearDamperEcsComponent to entity.

Parameters

world

EcsWorld

The ECS world entity belongs to.

entity

number

The entity to attach the component to.

options

LinearDamperOptions

Options for configuring the damper. Neither bodyA, bodyB, nor dampingCoefficient has a sensible default and all three must always be provided.

Returns

LinearDamperEcsComponent

The attached component, for further tuning or runtime changes.

Throws

An error if dampingCoefficient is negative.