Created
January 13, 2021 05:58
-
-
Save rvishwajith/c1a76334b14870c159680cd0c86f64d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rule1(Boid b) | |
Vector pC = <0, 0, 0> // Number of dimensions can change | |
FOR b2 in Boids | |
IF b != b2 // Ignore duplicate boids | |
pC += b2.position | |
pC = pC / (Boids.length - 1) | |
result = (pC - b.position) / 200 // 0.5% towards the percieved center | |
RETURN result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment