コード例 #1
0
//--------------------------------------------------------------
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();
	}
}
コード例 #2
0
//--------------------------------------------------------------
void ofxMtlMapping2DPolygon::init(int sId, bool defaultShape) 
{
    shapeId = sId;
	
    if (defaultShape) {
        createDefaultShape();
    }
    
    updatePolyline();
}
コード例 #3
0
//--------------------------------------------------------------
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();
    
}
コード例 #4
0
ファイル: wave.cpp プロジェクト: ofZach/funkyForms
// ------- update
void wave::update(vector<inputManager::Target> &targets){
    updateForces(targets);
    updatePolyline();
}