PositionDistanceConstraint

PositionDistanceConstraint is a Constraint that constrains the distance between two particles using a purely position-based method. This implementation is more energetically stable; however, it is also less energy conservative and cannot be affected by damping. The stiffness parameters are closer to a relaxation factor in [0,1]. Similar to other constraints, the stiffer this constraint, the less energy conservative it becomes. There is no "force" attached to this type of constraint, so a pseudo-force value is arbitrary calculated for any force based analysis.

Constructor

new PositionDistanceConstraint(c1, c2, len, stiffness, breakForce)

Instantiates new PositionDistanceConstraint

Parameters:
NameTypeDescription
c1Particle

particle 1

c2Particle

particle 2

lenNumber

constrained length

stiffnessNumber

a relaxation parameter that is stable between [0,1] (higher is more stiff)

breakForceNumber

force at which the constraint breaks

Extends

Methods

applyCorrection(timeStep)

Applies positional correction on particle.

Parameters:
NameTypeDescription
timeStepNumber

particles() → {Array.<Particle>}

Calculates the list of particles that is involved with the constraint

Returns:
Type: 
Array.<Particle>

update(timeStep)

Updates the constraint.

Parameters:
NameTypeDescription
timeStepNumber

vertices() → {Array.<Vector2D>}

Calculates the list of vertices that will be used in the rendering process

Returns:
Type: 
Array.<Vector2D>