//-------------------------------------------------------------- void ofxMtlMapping2DPolygon::update() { if (activePolygon == this) { list<ofxMtlMapping2DVertex*>::iterator it; for (it=vertices.begin(); it!=vertices.end(); it++) { ofxMtlMapping2DVertex* vertex = *it; if(ofxMtlMapping2DVertex::activeVertex == vertex) { activeVertexId = distance(vertices.begin(), it); } if (vertex->toBeRemoved) { vertex->kill(); vertices.remove(vertex); } } updatePolyline(); } //EST CE NECESSAIRE !!!! else { disableVertices(); } }
//-------------------------------------------------------------- void ofxMtlMapping2DPolygon::init(int sId, bool defaultShape) { shapeId = sId; if (defaultShape) { createDefaultShape(); } updatePolyline(); }
//-------------------------------------------------------------- void ofxMtlMapping2DPolygon::updatePosition(int xInc, int yInc) { list<ofxMtlMapping2DVertex*>::iterator it; for (it=vertices.begin(); it!=vertices.end(); it++) { ofxMtlMapping2DVertex* vertex = *it; vertex->setPos(vertex->x + xInc, vertex->y + yInc); vertex->updateCenter(); } updatePolyline(); }
// ------- update void wave::update(vector<inputManager::Target> &targets){ updateForces(targets); updatePolyline(); }