diff options
| author | realtradam <[email protected]> | 2021-08-09 09:15:38 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2021-08-09 09:15:38 -0400 |
| commit | 501ec02e894865836f2960b0bbc16b3448e3707f (patch) | |
| tree | ad2c1124e5ab5807dea1b11002cc5bf2df1226d9 /lib/04-seperation.rb | |
| parent | 4e909c6b44794b76ef3a98c032ea90204b673f85 (diff) | |
| download | ruboids-501ec02e894865836f2960b0bbc16b3448e3707f.tar.gz ruboids-501ec02e894865836f2960b0bbc16b3448e3707f.zip | |
ruboids!
Diffstat (limited to 'lib/04-seperation.rb')
| -rw-r--r-- | lib/04-seperation.rb | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/lib/04-seperation.rb b/lib/04-seperation.rb deleted file mode 100644 index dad82f6..0000000 --- a/lib/04-seperation.rb +++ /dev/null @@ -1,16 +0,0 @@ -FF::Scn::BoidCalculations.add(FF::Sys.new('Seperation', priority: 50) do - FF::Cmp::Boids.each do |boid_update| - newvec = [0,0] - FF::Cmp::Boids.each do |boid_check| - next if boid_check == boid_update - if Math.sqrt(((-boid_check.x + boid_update.x)**2) + ((-boid_check.y + boid_update.y)**2)).abs < 200 - puts 'repelling' - newvec[0] -= boid_check.x - boid_update.x - newvec[1] -= boid_check.y - boid_update.y - end - end - boid_update.cx += newvec[0] / 100.0 - boid_update.cy += newvec[1] / 100.0 - end - puts 'end of frame' -end) |
