Skip to content

Be smart about updating flock center and average velocity #2

@mlms13

Description

@mlms13

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions