From c616bc12f23162b6b1714ea936f4a2dafd0780a3 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 12 Nov 2021 11:51:54 +0100 Subject: Starting implementing collective moves. --- animation.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'animation.hpp') diff --git a/animation.hpp b/animation.hpp index b1ff815..31a466e 100644 --- a/animation.hpp +++ b/animation.hpp @@ -28,12 +28,16 @@ void initializeAnimation(int argc, char** argv, unsigned window_size = 1000) { template T> void draw(const Model<2, T>& m) { glClear(GL_COLOR_BUFFER_BIT); for (const Sphere<2>& p : m.particles) { + std::array color = {0, 0, 0}; + if (p.m) { + color = {0, 1, 0}; + } Sphere<2> pTmp = p; pTmp.x = m.orientation.inverse().act(p.x); - draw(pTmp); + draw(pTmp, color); if (pTmp.intersectsBoundary()) { for (Vector<2> Δy : {(Vector<2>){1,0}, {-1,0}, {0,1}, {0,-1}, {-1,1}, {1,1}, {1,-1},{-1,-1}}) { - draw({(Vector<2>)pTmp.x + Δy, p.r}); + draw({(Vector<2>)pTmp.x + Δy, p.r}, color); } } } -- cgit v1.2.3-54-g00ecf