//--------------------------------------------------------------
void ofxMtlMapping2DShape::update()
{
    _super::update();
    
    
    if(activePolygon != this && activePolygon != inputPolygon)
        return;
    
    if(activePolygon == this || (activePolygon == inputPolygon && inputPolygon) || (activePolygon == this && !inputPolygon && shapeType == MAPPING_2D_SHAPE_MASK)) {
        setAsActiveShape();
        
        // ---- recalculate the homography transformation matrix (for textured Shapes - for now only Quads) .
        calcHomography();
    }
    
    if (activeShape == this) {
        if (ofxMtlMapping2DControls::mapping2DControls()->mappingMode() == MAPPING_MODE_INPUT) {
            if (shapeType == MAPPING_2D_SHAPE_QUAD) {
                inputPolygon->update(true);
            } else {
                inputPolygon->update(false);
            }
        }
	}
}
예제 #2
0
//--------------------------------------------------------------
void mtl2dMappingShape::update()
{
    _super::update();
    
    
    if(activePolygon != this && activePolygon != inputPolygon)
        return;
    
    if(activePolygon == this || activePolygon == inputPolygon) {
        setAsActiveShape();
    }
    
    if (activeShape == this) {
        if (ControlsMapping::controlsMapping()->mappingMode() == MAPPING_MODE_INPUT) {
            inputPolygon->update();
        }
        
        // ---- recalculate the homography transformation matrix.
        calcHomography();
	}
}