diff --git a/particle_life/bin/interesting_models/waves b/particle_life/bin/interesting_models/waves new file mode 100644 index 0000000..6fcc638 --- /dev/null +++ b/particle_life/bin/interesting_models/waves @@ -0,0 +1 @@ +1.63334 47.1279 -56.928 -36.195 61.8049 18.3926 87.2929 32.2429 76.5575 -73.7449 -44.4862 -27.5472 112.955 64.3864 63.9446 13.5636 -65.4341 68.3151 -55.8538 60.4047 110.391 52.3731 31.2723 17.1192 -44.4179 1.14505 -63.5249 -7.51244 99.9638 83.9564 107.079 17.7316 3243 3175 3141 3108 0.5 \ No newline at end of file diff --git a/particle_life/src/main.cpp b/particle_life/src/main.cpp index 1bbdd3b..1a8f98a 100644 --- a/particle_life/src/main.cpp +++ b/particle_life/src/main.cpp @@ -4,11 +4,13 @@ //======================================================================== int main( ){ - ofSetupOpenGL(1600,900,OF_WINDOW); // <-------- setup the GL context + //ofSetupOpenGL(1600,900,OF_WINDOW); + ofGLWindowSettings s; + //s.setGLVersion(4, 3); + s.setSize(1600, 900); + //s.setPosition(glm::vec2(0, 0)); + ofCreateWindow(s); - // this kicks off the running of my app - // can be OF_WINDOW or OF_FULLSCREEN - // pass in width and height too: ofRunApp(new ofApp()); } diff --git a/particle_life/src/ofApp.cpp b/particle_life/src/ofApp.cpp index c8d35ee..bb0cf09 100644 --- a/particle_life/src/ofApp.cpp +++ b/particle_life/src/ofApp.cpp @@ -1,4 +1,5 @@ #include "ofApp.h" +#include "ofUtils.h" #include #include @@ -21,10 +22,12 @@ constexpr float rr = 8; //int countThresh = 0; std::string fps_text; +std::string physic_text; //Simulation parameters int cntFps = 0; clock_t now, lastTime, delta; +clock_t physic_begin, physic_delta; //Particle groups by color std::vector green; @@ -32,6 +35,9 @@ std::vector red; std::vector white; std::vector blue; +//Subdivison grid +grid subdiv; + /** * @brief Return a random float in range [a,b[ * @@ -39,7 +45,7 @@ std::vector blue; * @param b higher bound * @return random float */ -float RandomFloat(const float a, const float b) +inline float RandomFloat(const float a, const float b) { const float diff = b - a; const float r = ofRandomuf() * diff; @@ -65,7 +71,7 @@ void Draw(const std::vector* points) * @param b blue * @return a group of random point */ -std::vector CreatePoints(const int num, int r, int g, int b) +std::vector CreatePoints(const int num, const int r, const int g, const int b) { std::vector points; points.reserve(num); @@ -87,15 +93,15 @@ std::vector CreatePoints(const int num, int r, int g, int b) */ void ofApp::interaction(std::vector* Group1, const std::vector* Group2, const float G, const float radius) { - //Gravity coefficient - const float g = G / -100; + const float g = G / -100; //Gravity coefficient + const auto group1size = Group1->size(); + const auto group2size = Group2->size(); + const bool radius_toggle = radiusToogle; boundHeight = ofGetHeight(); boundWidth = ofGetWidth(); - const auto group1size = Group1->size(); - const auto group2size = Group2->size(); - #pragma omp parallel default(none) + #pragma omp parallel { std::random_device rd; #pragma omp for @@ -117,7 +123,7 @@ void ofApp::interaction(std::vector* Group1, const std::vector* Gr const auto r = dx * dx + dy * dy; //Calculate the force in given bounds. - if (r != 0 && r < (radius * radius)) + if ((r < radius * radius || radius_toggle) && r != 0.0F) { fx += (dx / std::sqrt(dx * dx + dy * dy)); fy += (dy / std::sqrt(dx * dx + dy * dy)); @@ -165,7 +171,6 @@ void ofApp::interaction(std::vector* Group1, const std::vector* Gr p1.y = boundHeight; } } - //(*Group1)[i] = p1; // seems to be useless } } } @@ -375,70 +380,108 @@ void ofApp::setup() { lastTime = clock(); ofSetWindowTitle("Particle Life - www.brainxyz.com"); + ofSetVerticalSync(false); + // Interface gui.setup("Settings"); gui.loadFont("Arial", 12); gui.setWidthElements(300.0f); - gui.add(resetButton.setup("START/RESTART")); - gui.add(randomChoice.setup("Randomize")); + gui.add(fps.setup("FPS", "0")); + + gui.add(resetButton.setup("Restart")); + gui.add(randomChoice.setup("Randomize (space bar)")); gui.add(save.setup("Save Model")); gui.add(load.setup("Load Model")); - gui.add(probabilitySlider.setup("Probability", probability, 1, 100)); - gui.add(viscoSlider.setup("Viscosity/Friction", viscosity, 0, 1)); - gui.add(gravitySlider.setup("Gravity", worldGravity, -1, 1)); - gui.add(wallRepelSlider.setup("Wall Repel", wallRepel, 0, 100)); - //gui.add(labelG.setup("GREEN:", "-")); - gui.add(numberSliderG.setup("GREEN:", pnumberSliderG, 0, 10000)); - gui.add(powerSliderGG.setup("green x green:", ppowerSliderGG, -100, 100)); - gui.add(powerSliderGR.setup("green x red:", ppowerSliderGR, -100, 100)); - gui.add(powerSliderGW.setup("green x white:", ppowerSliderGW, -100, 100)); - gui.add(powerSliderGB.setup("green x blue:", ppowerSliderGB, -100, 100)); - - gui.add(vSliderGG.setup("radius g x g:", pvSliderGG, 10, 500)); - gui.add(vSliderGR.setup("radius g x r:", pvSliderGR, 10, 500)); - gui.add(vSliderGW.setup("radius g x w:", pvSliderGW, 10, 500)); - gui.add(vSliderGB.setup("radius g x b:", pvSliderGB, 10, 500)); - - //gui.add(labelR.setup("RED:", "-")); - gui.add(numberSliderR.setup("RED:", pnumberSliderR, 0, 10000)); - gui.add(powerSliderRR.setup("red x red:", ppowerSliderRR, -100, 100)); - gui.add(powerSliderRG.setup("red x green:", ppowerSliderRG, -100, 100)); - gui.add(powerSliderRW.setup("red x white:", ppowerSliderRW, -100, 100)); - gui.add(powerSliderRB.setup("red x blue:", ppowerSliderRB, -100, 100)); - - gui.add(vSliderRG.setup("radius r x g:", pvSliderRG, 10, 500)); - gui.add(vSliderRR.setup("radius r x r:", pvSliderRR, 10, 500)); - gui.add(vSliderRW.setup("radius r x w:", pvSliderRW, 10, 500)); - gui.add(vSliderRB.setup("radius r x b:", pvSliderRB, 10, 500)); - - //gui.add(labelW.setup("WHITE:", "-")); - gui.add(numberSliderW.setup("WHITE:", pnumberSliderW, 0, 10000)); - gui.add(powerSliderWW.setup("white x white:", ppowerSliderWW, -100, 100)); - gui.add(powerSliderWR.setup("white x red:", ppowerSliderWR, -100, 100)); - gui.add(powerSliderWG.setup("white x green:", ppowerSliderWG, -100, 100)); - gui.add(powerSliderWB.setup("white x blue:", ppowerSliderWB, -100, 100)); - - gui.add(vSliderWG.setup("radius w x g:", pvSliderWG, 10, 500)); - gui.add(vSliderWR.setup("radius w x r:", pvSliderWR, 10, 500)); - gui.add(vSliderWW.setup("radius w x w:", pvSliderWW, 10, 500)); - gui.add(vSliderWB.setup("radius w x b:", pvSliderWB, 10, 500)); - - //gui.add(labelB.setup("BLUE:", "-")); - gui.add(numberSliderB.setup("BLUE:", pnumberSliderB, 0, 10000)); - gui.add(powerSliderBB.setup("blue x blue:", ppowerSliderBB, -100, 100)); - gui.add(powerSliderBW.setup("blue x white:", ppowerSliderBW, -100, 100)); - gui.add(powerSliderBR.setup("blue x red:", ppowerSliderBR, -100, 100)); - gui.add(powerSliderBG.setup("blue x green:", ppowerSliderBG, -100, 100)); - - gui.add(vSliderBG.setup("radius b x g:", pvSliderBG, 10, 500)); - gui.add(vSliderBR.setup("radius b x r:", pvSliderBR, 10, 500)); - gui.add(vSliderBW.setup("radius b x w:", pvSliderBW, 10, 500)); - gui.add(vSliderBB.setup("radius b x b:", pvSliderBB, 10, 500)); - gui.add(boundsToggle.setup("Bounded", true)); gui.add(modelToggle.setup("Show Model", false)); - gui.add(motionBlurToggle.setup("Motion Blur", false)); - gui.add(fps.setup("FPS", "0")); + + globalGroup.setup("Global"); + globalGroup.add(viscoSlider.setup("Viscosity/Friction", viscosity, 0, 1)); + globalGroup.add(gravitySlider.setup("Gravity", worldGravity, -1, 1)); + globalGroup.add(wallRepelSlider.setup("Wall Repel", wallRepel, 0, 100)); + globalGroup.add(boundsToggle.setup("Bounded", false)); + + gui.add(&globalGroup); + + // Quantity + qtyGroup.setup("Quantity (require restart/randomize)"); + qtyGroup.add(numberSliderG.setup("Green", pnumberSliderG, 0, 10000)); + qtyGroup.add(numberSliderR.setup("Red", pnumberSliderR, 0, 10000)); + qtyGroup.add(numberSliderW.setup("White", pnumberSliderW, 0, 10000)); + qtyGroup.add(numberSliderB.setup("Blue", pnumberSliderB, 0, 10000)); + gui.add(&qtyGroup); + + // GREEN + greenGroup.setup("Green"); + greenGroup.add(powerSliderGG.setup("green x green:", ppowerSliderGG, -100, 100)); + greenGroup.add(powerSliderGR.setup("green x red:", ppowerSliderGR, -100, 100)); + greenGroup.add(powerSliderGW.setup("green x white:", ppowerSliderGW, -100, 100)); + greenGroup.add(powerSliderGB.setup("green x blue:", ppowerSliderGB, -100, 100)); + + greenGroup.add(vSliderGG.setup("radius g x g:", pvSliderGG, 10, 500)); + greenGroup.add(vSliderGR.setup("radius g x r:", pvSliderGR, 10, 500)); + greenGroup.add(vSliderGW.setup("radius g x w:", pvSliderGW, 10, 500)); + greenGroup.add(vSliderGB.setup("radius g x b:", pvSliderGB, 10, 500)); + + greenGroup.minimize(); + gui.add(&greenGroup); + + // RED + redGroup.setup("Red"); + redGroup.add(powerSliderRR.setup("red x red:", ppowerSliderRR, -100, 100)); + redGroup.add(powerSliderRG.setup("red x green:", ppowerSliderRG, -100, 100)); + redGroup.add(powerSliderRW.setup("red x white:", ppowerSliderRW, -100, 100)); + redGroup.add(powerSliderRB.setup("red x blue:", ppowerSliderRB, -100, 100)); + + redGroup.add(vSliderRG.setup("radius r x g:", pvSliderRG, 10, 500)); + redGroup.add(vSliderRR.setup("radius r x r:", pvSliderRR, 10, 500)); + redGroup.add(vSliderRW.setup("radius r x w:", pvSliderRW, 10, 500)); + redGroup.add(vSliderRB.setup("radius r x b:", pvSliderRB, 10, 500)); + + redGroup.minimize(); + gui.add(&redGroup); + + // WHITE + whiteGroup.setup("White"); + whiteGroup.add(powerSliderWW.setup("white x white:", ppowerSliderWW, -100, 100)); + whiteGroup.add(powerSliderWR.setup("white x red:", ppowerSliderWR, -100, 100)); + whiteGroup.add(powerSliderWG.setup("white x green:", ppowerSliderWG, -100, 100)); + whiteGroup.add(powerSliderWB.setup("white x blue:", ppowerSliderWB, -100, 100)); + + whiteGroup.add(vSliderWG.setup("radius w x g:", pvSliderWG, 10, 500)); + whiteGroup.add(vSliderWR.setup("radius w x r:", pvSliderWR, 10, 500)); + whiteGroup.add(vSliderWW.setup("radius w x w:", pvSliderWW, 10, 500)); + whiteGroup.add(vSliderWB.setup("radius w x b:", pvSliderWB, 10, 500)); + + whiteGroup.minimize(); + gui.add(&whiteGroup); + + // BLUE + blueGroup.setup("Blue"); + blueGroup.add(powerSliderBB.setup("blue x blue:", ppowerSliderBB, -100, 100)); + blueGroup.add(powerSliderBW.setup("blue x white:", ppowerSliderBW, -100, 100)); + blueGroup.add(powerSliderBR.setup("blue x red:", ppowerSliderBR, -100, 100)); + blueGroup.add(powerSliderBG.setup("blue x green:", ppowerSliderBG, -100, 100)); + + blueGroup.add(vSliderBG.setup("radius b x g:", pvSliderBG, 10, 500)); + blueGroup.add(vSliderBR.setup("radius b x r:", pvSliderBR, 10, 500)); + blueGroup.add(vSliderBW.setup("radius b x w:", pvSliderBW, 10, 500)); + blueGroup.add(vSliderBB.setup("radius b x b:", pvSliderBB, 10, 500)); + + blueGroup.minimize(); + gui.add(&blueGroup); + + expGroup.setup("Experimental"); + expGroup.add(evoToggle.setup("Evolve parameters", false)); + expGroup.add(evoProbSlider.setup("evo chance%", evoChance, 0, 100)); + expGroup.add(evoAmountSlider.setup("evo amount%%", evoAmount, 0, 100)); + expGroup.add(radiusToogle.setup("infinite radius", false)); + expGroup.add(probabilitySlider.setup("interaction prob%", probability, 1, 100)); + expGroup.add(motionBlurToggle.setup("Motion Blur", false)); + expGroup.add(physicLabel.setup("physic (ms)", "0")); + + expGroup.minimize(); + gui.add(&expGroup); ofSetBackgroundAuto(false); ofEnableAlphaBlending(); @@ -449,10 +492,84 @@ void ofApp::setup() //------------------------------Update simulation with sliders values------------------------------ void ofApp::update() { + physic_begin = clock(); probability = probabilitySlider; viscosity = viscoSlider; worldGravity = gravitySlider; wallRepel = wallRepelSlider; + evoChance = evoProbSlider; + evoAmount = evoAmountSlider; + + if(evoToggle && ofRandom(1.0F) < (evoChance / 100.0F)) + { + powerSliderRR = powerSliderRR + ((ofRandom(2.0F) - 1.0F) * (powerSliderRR.getMax() - powerSliderRR.getMin()) * (evoAmount / 100.0F)); + powerSliderRG = powerSliderRG + ((ofRandom(2.0F) - 1.0F) * (powerSliderRG.getMax() - powerSliderRG.getMin()) * (evoAmount / 100.0F)); + powerSliderRB = powerSliderRB + ((ofRandom(2.0F) - 1.0F) * (powerSliderRB.getMax() - powerSliderRB.getMin()) * (evoAmount / 100.0F)); + powerSliderRW = powerSliderRW + ((ofRandom(2.0F) - 1.0F) * (powerSliderRW.getMax() - powerSliderRW.getMin()) * (evoAmount / 100.0F)); + powerSliderGR = powerSliderGR + ((ofRandom(2.0F) - 1.0F) * (powerSliderGR.getMax() - powerSliderGR.getMin()) * (evoAmount / 100.0F)); + powerSliderGG = powerSliderGG + ((ofRandom(2.0F) - 1.0F) * (powerSliderGG.getMax() - powerSliderGG.getMin()) * (evoAmount / 100.0F)); + powerSliderGB = powerSliderGB + ((ofRandom(2.0F) - 1.0F) * (powerSliderGB.getMax() - powerSliderGB.getMin()) * (evoAmount / 100.0F)); + powerSliderGW = powerSliderGW + ((ofRandom(2.0F) - 1.0F) * (powerSliderGW.getMax() - powerSliderGW.getMin()) * (evoAmount / 100.0F)); + powerSliderBR = powerSliderBR + ((ofRandom(2.0F) - 1.0F) * (powerSliderBR.getMax() - powerSliderBR.getMin()) * (evoAmount / 100.0F)); + powerSliderBG = powerSliderBG + ((ofRandom(2.0F) - 1.0F) * (powerSliderBG.getMax() - powerSliderBG.getMin()) * (evoAmount / 100.0F)); + powerSliderBB = powerSliderBB + ((ofRandom(2.0F) - 1.0F) * (powerSliderBB.getMax() - powerSliderBB.getMin()) * (evoAmount / 100.0F)); + powerSliderBW = powerSliderBW + ((ofRandom(2.0F) - 1.0F) * (powerSliderBW.getMax() - powerSliderBW.getMin()) * (evoAmount / 100.0F)); + powerSliderWR = powerSliderWR + ((ofRandom(2.0F) - 1.0F) * (powerSliderWR.getMax() - powerSliderWR.getMin()) * (evoAmount / 100.0F)); + powerSliderWG = powerSliderWG + ((ofRandom(2.0F) - 1.0F) * (powerSliderWG.getMax() - powerSliderWG.getMin()) * (evoAmount / 100.0F)); + powerSliderWB = powerSliderWB + ((ofRandom(2.0F) - 1.0F) * (powerSliderWB.getMax() - powerSliderWB.getMin()) * (evoAmount / 100.0F)); + powerSliderWW = powerSliderWW + ((ofRandom(2.0F) - 1.0F) * (powerSliderWW.getMax() - powerSliderWW.getMin()) * (evoAmount / 100.0F)); + + vSliderRR = vSliderRR + ((ofRandom(2.0F) - 1.0F) * (vSliderRR.getMax() - vSliderRR.getMin()) * (evoAmount / 100.0F)); + vSliderRG = vSliderRG + ((ofRandom(2.0F) - 1.0F) * (vSliderRG.getMax() - vSliderRG.getMin()) * (evoAmount / 100.0F)); + vSliderRB = vSliderRB + ((ofRandom(2.0F) - 1.0F) * (vSliderRB.getMax() - vSliderRB.getMin()) * (evoAmount / 100.0F)); + vSliderRW = vSliderRW + ((ofRandom(2.0F) - 1.0F) * (vSliderRW.getMax() - vSliderRW.getMin()) * (evoAmount / 100.0F)); + vSliderGR = vSliderGR + ((ofRandom(2.0F) - 1.0F) * (vSliderGR.getMax() - vSliderGR.getMin()) * (evoAmount / 100.0F)); + vSliderGG = vSliderGG + ((ofRandom(2.0F) - 1.0F) * (vSliderGG.getMax() - vSliderGG.getMin()) * (evoAmount / 100.0F)); + vSliderGB = vSliderGB + ((ofRandom(2.0F) - 1.0F) * (vSliderGB.getMax() - vSliderGB.getMin()) * (evoAmount / 100.0F)); + vSliderGW = vSliderGW + ((ofRandom(2.0F) - 1.0F) * (vSliderGW.getMax() - vSliderGW.getMin()) * (evoAmount / 100.0F)); + vSliderBR = vSliderBR + ((ofRandom(2.0F) - 1.0F) * (vSliderBR.getMax() - vSliderBR.getMin()) * (evoAmount / 100.0F)); + vSliderBG = vSliderBG + ((ofRandom(2.0F) - 1.0F) * (vSliderBG.getMax() - vSliderBG.getMin()) * (evoAmount / 100.0F)); + vSliderBB = vSliderBB + ((ofRandom(2.0F) - 1.0F) * (vSliderBB.getMax() - vSliderBB.getMin()) * (evoAmount / 100.0F)); + vSliderBW = vSliderBW + ((ofRandom(2.0F) - 1.0F) * (vSliderBW.getMax() - vSliderBW.getMin()) * (evoAmount / 100.0F)); + vSliderWR = vSliderWR + ((ofRandom(2.0F) - 1.0F) * (vSliderWR.getMax() - vSliderWR.getMin()) * (evoAmount / 100.0F)); + vSliderWG = vSliderWG + ((ofRandom(2.0F) - 1.0F) * (vSliderWG.getMax() - vSliderWG.getMin()) * (evoAmount / 100.0F)); + vSliderWB = vSliderWB + ((ofRandom(2.0F) - 1.0F) * (vSliderWB.getMax() - vSliderWB.getMin()) * (evoAmount / 100.0F)); + vSliderWW = vSliderWW + ((ofRandom(2.0F) - 1.0F) * (vSliderWW.getMax() - vSliderWW.getMin()) * (evoAmount / 100.0F)); + + if(vSliderRR < 0.0F) vSliderRR = 0; + if(vSliderRG < 0.0F) vSliderRG = 0; + if(vSliderRB < 0.0F) vSliderRB = 0; + if(vSliderRW < 0.0F) vSliderRW = 0; + if(vSliderGR < 0.0F) vSliderGR = 0; + if(vSliderGG < 0.0F) vSliderGG = 0; + if(vSliderGB < 0.0F) vSliderGB = 0; + if(vSliderGW < 0.0F) vSliderGW = 0; + if(vSliderBR < 0.0F) vSliderBR = 0; + if(vSliderBG < 0.0F) vSliderBG = 0; + if(vSliderBB < 0.0F) vSliderBB = 0; + if(vSliderBW < 0.0F) vSliderBW = 0; + if(vSliderWR < 0.0F) vSliderWR = 0; + if(vSliderWG < 0.0F) vSliderWG = 0; + if(vSliderWB < 0.0F) vSliderWB = 0; + if(vSliderWW < 0.0F) vSliderWW = 0; + + if (vSliderRR > 200.0F) vSliderRR = 200.0F; + if (vSliderRG > 200.0F) vSliderRG = 200.0F; + if (vSliderRB > 200.0F) vSliderRB = 200.0F; + if (vSliderRW > 200.0F) vSliderRW = 200.0F; + if (vSliderGR > 200.0F) vSliderGR = 200.0F; + if (vSliderGG > 200.0F) vSliderGG = 200.0F; + if (vSliderGB > 200.0F) vSliderGB = 200.0F; + if (vSliderGW > 200.0F) vSliderGW = 200.0F; + if (vSliderBR > 200.0F) vSliderBR = 200.0F; + if (vSliderBG > 200.0F) vSliderBG = 200.0F; + if (vSliderBB > 200.0F) vSliderBB = 200.0F; + if (vSliderBW > 200.0F) vSliderBW = 200.0F; + if (vSliderWR > 200.0F) vSliderWR = 200.0F; + if (vSliderWG > 200.0F) vSliderWG = 200.0F; + if (vSliderWB > 200.0F) vSliderWB = 200.0F; + if (vSliderWW > 200.0F) vSliderWW = 200.0F; + } if (numberSliderR > 0) { @@ -488,6 +605,7 @@ void ofApp::update() if (save) { saveSettings(); } if (load) { loadSettings(); } + physic_delta = clock() - physic_begin; } //-------------------------------------------------------------- @@ -513,6 +631,8 @@ void ofApp::draw() { lastTime = now; fps.setup("FPS", to_string(static_cast((1000 / static_cast(delta)) * cntFps))); + physicLabel.setup("physics (ms)", to_string(physic_delta) ); + cntFps = 0; } diff --git a/particle_life/src/ofApp.h b/particle_life/src/ofApp.h index d623050..554b7f1 100644 --- a/particle_life/src/ofApp.h +++ b/particle_life/src/ofApp.h @@ -3,29 +3,31 @@ #include "ofMain.h" #include "ofxGui.h" +#define GRID_DIV 4 + +/* + * for collision detection : + * if (distance(x center, x line) < radius) then intersect + */ + struct point { + point(float _x, float _y, const int _r, const int _g, const int _b) : x(_x), y(_y), r(_r), g(_g), b(_b) {} + //Position - float x = 0; - float y = 0; + float x; + float y; //Velocity float vx = 0; float vy = 0; //Color - int r = 0; - int g = 0; - int b = 0; + const int r; + const int g; + const int b; - point(const float _x, const float _y, const int _r, const int _g, const int _b) - { - x = _x; - y = _y; - r = _r; - g = _g; - b = _b; - } + int gridId = -1; void draw() const { @@ -34,6 +36,10 @@ struct point } }; +struct grid +{ + const int gridSize = GRID_DIV * GRID_DIV; // must be a power of 2 +}; //---------------------------------------------CONFIGURE GUI---------------------------------------------// class ofApp final : public ofBaseApp @@ -51,17 +57,36 @@ class ofApp final : public ofBaseApp ofxPanel gui; + ofxGuiGroup globalGroup; + ofxGuiGroup qtyGroup; + ofxGuiGroup redGroup; + ofxGuiGroup greenGroup; + ofxGuiGroup blueGroup; + ofxGuiGroup whiteGroup; + ofxButton resetButton; ofxButton selectButton; ofxButton randomChoice; ofxButton save; ofxButton load; + ofxToggle boundsToggle; ofxToggle modelToggle; ofxToggle motionBlurToggle; + // some experimental stuff here + ofxGuiGroup expGroup; + ofxToggle evoToggle; + ofxFloatSlider evoProbSlider; + ofxFloatSlider evoAmountSlider; + float evoChance = 1; + float evoAmount = 1; + ofxToggle radiusToogle; + ofxLabel physicLabel; + //end of experimental + ofxIntSlider probabilitySlider; - int probability = 100; + unsigned int probability = 100; ofxIntSlider numberSliderR; ofxIntSlider numberSliderG; @@ -97,7 +122,6 @@ class ofApp final : public ofBaseApp float ppowerSliderGW = 0; float ppowerSliderGB = 0; - ofxFloatSlider powerSliderWR; ofxFloatSlider powerSliderWG; ofxFloatSlider powerSliderWW; @@ -157,14 +181,15 @@ class ofApp final : public ofBaseApp float pvSliderBG = 180; float pvSliderBW = 180; float pvSliderBB = 180; + ofxLabel labelG; ofxLabel labelR; ofxLabel labelW; ofxLabel labelB; - ofxLabel aboutL1; ofxLabel aboutL2; ofxLabel aboutL3; + ofxLabel fps; // simulation bounds int boundWidth = 1600; @@ -175,6 +200,4 @@ class ofApp final : public ofBaseApp float forceVariance = 0.8F; float radiusVariance = 0.6F; float wallRepel = 20.0F; - - ofxLabel fps; };