Skip to main content

Function: createLinearDamperEcsSystem()

createLinearDamperEcsSystem(time): EcsSystem<[LinearDamperEcsComponent], void>

Defined in: physics/systems/linear-damper.system.ts:31

Creates an ECS system that applies each matched entity's LinearDamperEcsComponent resistive force to bodyA/bodyB every tick: F = -c * v, where v is the relative velocity of the two anchor points projected onto the line between them (their compression/extension speed), and c is dampingCoefficient. Relative motion perpendicular to that line is left unaffected. The force is scaled by deltaTimeInSeconds and applied via RigidBody.applyImpulse (the same continuous-force-via- scaled-impulse pattern used for gravity and wind, see the Applying Forces guide).

Must be registered with the EcsWorld before createPhysicsSyncEcsSystem (or with an earlier registrationOrder), so the force applied this tick is reflected in the same tick's physicsWorld.step.

Parameters

time

Time

The time instance used to scale the force by the tick's delta time.

Returns

EcsSystem<[LinearDamperEcsComponent], void>