PositionPivotConstraint

PositionPivotConstraint is a Constraint that limits the motion of a particle to a certain length away from a point in space. The implementation of this constraint is position-based like that of PositionDistanceConstraint.

Constructor

new PositionPivotConstraint(pos, c1, len, stiffness, breakForce)

Instantiates new PositionPivotConstraint

Parameters:
NameTypeDescription
posVector2D

position of pivot

c1Particle

constrained particle

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>