//-------------------------------------------------------------- void ofApp::update() { ofBackground(255); location__.set(ofGetWidth() / 2, 100); Partical harry = Partical(location__); MoreParticles.push_back(harry); ofLog(OF_LOG_NOTICE, "Particles " + ofToString(MoreParticles.size())); }
void ParticalEffect::updateFire(float dt, const int scount, int type) { count = scount; for (int x = 0; x < count; x ++) { if(!partsA[x].active) { int mouseX, mouseY; Core::Input::GetMousePos( mouseX, mouseY ); Vector2D mouse((float)mouseX, (float)mouseY); partsA[x] = Partical(); float randInt = randomInRange(1,10); Vector2D rand; if(type == 1) { rand = RandomUnitVector() * randInt; } else { } Vector2D newPath = mouse + rand; partsA[x].updateFire(dt, mouse, newPath); } } }