falcowinkler / flockingbird

Flocking algorithm implementation in c++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flockingbird

A header-only c++ library for creating 2D flocking animations. http://www.cs.toronto.edu/~dt/siggraph97-course/cwr87/

demo500

The algorithm uses kD-Trees to calculate the neighbors of a boid, making it possible to simulate more than a thousand boids (depending on framerate, compiler optimization level, and processor speed).

Please use the highest optimization level if you compile the library yourself. 500 boids is already difficult with the default optimization, whereas with -O3 you can easiliy run a 1000 boid simulation.

setup

(I don't have a windows PC, so just for mac)

brew install cmake
brew install llvm
brew install clang-format # for working on the project/formatting

Dependencies

For the demo animation:

brew install cairo
brew install gtk+3

NOTE: i had to

export LDFLAGS="-L/usr/local/Cellar/cairo/1.16.0_5/lib $LDFLAGS"

build

cd build
cmake ..
make && make install

build and test

./test.sh

run demo

./build/flockingbird_demo

emacs integration

make sure that compile_commands is linked to the root

ln build/compile_commands.json .

Credits/Disclaimer

Resources used for development

Bindings

  • Swift (Work in progress)

About

Flocking algorithm implementation in c++

License:MIT License


Languages

Language:C++ 97.3%Language:CMake 2.5%Language:Shell 0.1%