Skip to content

Instantly share code, notes, and snippets.

@rvishwajith
Created January 13, 2021 05:57
Show Gist options
  • Save rvishwajith/9ab0ece947c2d298b6342284f3c667d4 to your computer and use it in GitHub Desktop.
Save rvishwajith/9ab0ece947c2d298b6342284f3c667d4 to your computer and use it in GitHub Desktop.
centerOfMass() // A general rule for finding the overall center
Vector result
FOR b in Boids
result += b.position
result /= Boids.length
RETURN result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment