Function: addLinearSpringComponent()
addLinearSpringComponent(
world,entity,options):LinearSpringEcsComponent
Defined in: physics/components/linear-spring-component.ts:93
Attaches a LinearSpringEcsComponent to entity.
Parameters
world
The ECS world entity belongs to.
entity
number
The entity to attach the component to.
options
Options for configuring the spring. Neither bodyA,
bodyB, nor stiffness has a sensible default and all three must always
be provided.
Returns
The attached component, for further tuning or runtime changes.
Throws
An error if stiffness is negative.