new PinConstraint(A, x, y)
Creates an instance of pin constraint. This constraint will be used as rule
for modifying two particles (projection). The pin constraint hard pins a
particle to a specific position in space.
Parameters:
Name | Type | Description |
---|---|---|
A |
number | Index of the particle that needs to be constrained. |
x |
number | X position the particle needs to be hard constrained to. |
y |
number | Y position the particle needs to be hard constrained to. |
Methods
project(curPositions) → {boolean}
Adjusts the position of the particle associated with the constraint in
order to satisfy it. This method will get called in the
ParticleSystem#satisfyConstraints.
Parameters:
Name | Type | Description |
---|---|---|
curPositions |
list | The current list of particles so it can be modified. |
Returns:
If the constraint is still alive, in oder words if it does
not have to be deleted.
- Type
- boolean