Springs plugin for Matter JS
Creates a new spring.
All properties are optional.
See the properties section below for detailed information on what you can pass via the options
object.
- {} options
- spring spring
- number id An integer
Number
uniquely identifying number generated inComposite.create
byCommon.nextId
.
- string type A readonly
string
denoting the type of object. (Default"spring"
)
- Matter.Body bodyA The first possible
Body
that this spring is attached to. (Defaultnull
)
- Matter.Body bodyB The second possible
Body
that this spring is attached to. (Defaultnull
)
- Vector pointA A
Vector
that specifies the offset of the spring from center of thespring.bodyA
if defined, otherwise a world-space position. (Default{ x: 0, y: 0 }
)
- Vector pointB A
Vector
that specifies the offset of the spring from center of thespring.bodyA
if defined, otherwise a world-space position. (Default{ x: 0, y: 0 }
)
- number stiffness A
number
that specifies the stiffness of the spring. (Default0.5
)
- number damping A
Number
that specifies the damping applied to the spring. (Default0.2
)
- number length A
number
that specifies the length of the spring. (Default0
)