Constructor
new PositionDistanceConstraint(c1, c2, len, stiffness, breakForce)
Instantiates new PositionDistanceConstraint
Name | Type | Description |
---|---|---|
c1 | Particle | particle 1 |
c2 | Particle | particle 2 |
len | Number | constrained length |
stiffness | Number | a relaxation parameter that is stable between [0,1] (higher is more stiff) |
breakForce | Number | force at which the constraint breaks |
Extends
Methods
applyCorrection(timeStep)
Applies positional correction on particle.
Name | Type | Description |
---|---|---|
timeStep | Number |
- Overrides
particles() → {Array.<Particle>}
Calculates the list of particles that is involved with the constraint
- Overrides
- Type:
- Array.<Particle>
update(timeStep)
Updates the constraint.
Name | Type | Description |
---|---|---|
timeStep | Number |
- Overrides
vertices() → {Array.<Vector2D>}
Calculates the list of vertices that will be used in the rendering process
- Overrides
- Type:
- Array.<Vector2D>