I found ability to react on entity click crucial for my project so I think it could be useful to contain it in default verlet-js behaviour.
I've added entityClicked event and also made few performance improvements in nearestEntity function:
selectionRadiusSquare computed at the beginning to avoid computations in every loop
traditional for instead of for...in
breaking last loop after successful PinConstraint finding (further looping is not needed)
Hi,
I found ability to react on entity click crucial for my project so I think it could be useful to contain it in default verlet-js behaviour. I've added
entityClicked
event and also made few performance improvements innearestEntity
function:selectionRadiusSquare
computed at the beginning to avoid computations in every loopfor
instead offor...in
PinConstraint
finding (further looping is not needed)Hope you'll enjoy it
Best Regards :)