Closed Jared-Sprague closed 7 years ago
Nice work!
I've reviewed the PR and i have a few changes and fixes for both the advance() and the boids demo. Do you mind if i merge our PR and then change it on the master branch?
Sounds good to me! @Jared-Sprague? By the way, thank you @spite for making this!
Sounds good thanks!
Ok. That should be it. Merged and updated.
The most relevant changes should be:
For the lib:
For the demo:
I think that's all, I hope I haven't broken anything.
Again, thanks for the work!
@spite Ah i love the changes! Especially the memcopy so clever!
One question, will you uplaod the trails demo and link to it from the readme?
Yes, of course, with full credits! I can host it on my domain, or link to your online version.
I think it makes the most sense to put it in the same location as the other demos. I actually haven't uploaded it anywhere. Thanks!
@spite of course I'm happy to host the tail demo if you want!
Sorry, I've been AFK until now. I've hosted it with the other demos, no worries. All done!
@spite thanks you rock! and thanks for the mention!
Hey @spite! We started using this library to add dynamic trails to moving objects, and quickly learned that calling setGeometry() everytime the line changes, is very in efficient and slow as it completely rebuilds the line. And 4 of the arrays that it build are static based on the length of the line and never change. @mwcz and I created the
advance()
function advances the line by one position by modifying the buffer attribute typed arrays directly for Next, Current, and Previous positions. This is so much faster than calling setGeometry() for 1 new position. See the included demo that adds trails to the flocking birds demo.