Neighbor stop on little velocity changes

This commit is contained in:
Pitchaya Boonsarngsuk
2018-01-17 09:55:43 +00:00
parent 7b6b5e46c6
commit 5ece153651
3 changed files with 97 additions and 77 deletions

View File

@@ -34,13 +34,16 @@ export default function (nodes, config) {
})
.on("end", ended);
sampleSimulation.force("forces", neighbourSamplingDistance()
sampleSimulation
.force("forces", neighbourSamplingDistance()
.neighbourSize(neighbourSize)
.sampleSize(sampleSize)
.distanceRange(distanceRange)
.distance(distanceFn)
);
sampleSimulation.alpha(1).restart();
.stableVelocity(60)
.stableVeloHandler(function(){sampleSimulation.stop(); ended();})
)
.alpha(1).restart();
function ended() {
event.call("startFull");