Open lo-fo opened 9 years ago
How would one add an effect of inertia on a particle ?
let's say i would like to improve the example from the guide (copy/pasted here)
var mousePin = null; renderer.on('pointerdown', function(point) { var particle = sim.findNearest(point, 30); if (particle) mousePin = sim.add(Newton.PinConstraint(particle, point)); }); renderer.on('pointerup', function(point) { if (!mousePin) return; sim.remove(mousePin); mousePin = null; });
And i would like the particle to continue its movement upon mouse release, and slowly stop until its completely static.
Since forces are applied globally on all particles, the way to go would be to make an inertia constraint to target a specific particle. Am i right ?
How would one add an effect of inertia on a particle ?
let's say i would like to improve the example from the guide (copy/pasted here)
And i would like the particle to continue its movement upon mouse release, and slowly stop until its completely static.
Since forces are applied globally on all particles, the way to go would be to make an inertia constraint to target a specific particle. Am i right ?