Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be smart about updating flock center and average velocity #2

Open
mlms13 opened this issue Nov 3, 2014 · 0 comments
Open

Be smart about updating flock center and average velocity #2

mlms13 opened this issue Nov 3, 2014 · 0 comments

Comments

@mlms13
Copy link
Owner

mlms13 commented Nov 3, 2014

Currently, the flock center point and average velocity are updated at the beginning of each positionBoids cycle. This requires a completely separate iteration over each boid in the flock. What if we lived in a world where we updated the flock's center/velocity each time we added or re-positioned a boid? This way the values would always be up-to-date, and we could do everything in a single loop, instead of two.

Maybe we want to do some FPS profiling... This update would mean setting those values more often, but it would also mean dropping one of our successive iterations. I guess it depends a little how much overhead there is in iteration vs re-writing properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant