diff --git a/addons/ofxPiMapper/src/Gui/Widgets/ProjectionEditorWidget.cpp b/addons/ofxPiMapper/src/Gui/Widgets/ProjectionEditorWidget.cpp index 8a1adb4..6023d66 100644 --- a/addons/ofxPiMapper/src/Gui/Widgets/ProjectionEditorWidget.cpp +++ b/addons/ofxPiMapper/src/Gui/Widgets/ProjectionEditorWidget.cpp @@ -39,7 +39,7 @@ void ProjectionEditorWidget::mouseDragged(ofMouseEventArgs & args){ // Pass args to joint mouse events for(unsigned int i = 0; i < joints.size(); ++i){ - if (joints[i]->isDragged()) { + if (joints[i]->isDragged() && !boundary::is_collided_joint(ofVec2f(args.x, args.y), joints[i], joints)) { surfaceManager->getSelectedSurface()->setVertex(i, boundary::bounded_position(args)); } @@ -64,7 +64,7 @@ void ProjectionEditorWidget::mouseDragged(ofMouseEventArgs & args){ if(joints[i]->isDragged()){ for(int j = 0; j < allVertices.size(); j++){ float distance = mousePosition.distance(*allVertices[j]); - if(distance < fSnapDistance){ + if(distance < fSnapDistance && !boundary::is_collided_joint(ofVec2f(args.x, args.y), joints[i], joints)){ joints[i]->position = *allVertices[j]; ofVec2f clickDistance = joints[i]->position - ofVec2f(args.x, args.y); joints[i]->setClickDistance(clickDistance); @@ -111,16 +111,14 @@ void ProjectionEditorWidget::touchMoved(map &active_joint if (joints[i]->isDragged()) { for (int j = 0; j < allVertices.size(); j++) { float distance = touchPosition.distance(*allVertices[j]); - if (distance < fSnapDistance) { + if (distance < fSnapDistance && !boundary::is_collided_joint(joint_touch.second, joints[joint_touch.first], joints)) { joints[i]->position = *allVertices[j]; ofVec2f clickDistance = joints[i]->position - ofVec2f(joint_touch.second.x, joint_touch.second.y); joints[i]->setClickDistance(clickDistance); if (joint_touch.first < joints.size() && joints[joint_touch.first]->isDragged()) { - if (!boundary::is_collided_joint(joint_touch.second, joints[joint_touch.first], joints)) { - surfaceManager->getSelectedSurface()->setVertex(i, - boundary::bounded_position(joints[i]->position)); - } + surfaceManager->getSelectedSurface()->setVertex(i, + boundary::bounded_position(joints[i]->position)); } break; } diff --git a/addons/ofxPiMapper/src/Surfaces/QuadSurface.cpp b/addons/ofxPiMapper/src/Surfaces/QuadSurface.cpp index 4740899..9d2e188 100644 --- a/addons/ofxPiMapper/src/Surfaces/QuadSurface.cpp +++ b/addons/ofxPiMapper/src/Surfaces/QuadSurface.cpp @@ -121,7 +121,6 @@ void QuadSurface::setVertex(int index, ofVec2f p){ mesh.setVertex(index, p); if (is_concave()) { - cout << "concave" << endl; mesh.setVertex(index, p_s); } ofVec3f v = mesh.getVertex(index); diff --git a/bin/data/ofxpimapper.xml b/bin/data/ofxpimapper.xml index e4a4fe0..9a96f73 100644 --- a/bin/data/ofxpimapper.xml +++ b/bin/data/ofxpimapper.xml @@ -149,20 +149,20 @@ - 845.000000000 - 411.000000000 + 745.000000000 + 471.000000000 - 1107.000000000 - 417.000000000 + 792.000000000 + 472.000000000 - 1049.000000000 - 521.000000000 + 699.000000000 + 635.000000000 - 815.000000000 - 521.000000000 + 465.000000000 + 635.000000000 diff --git a/src/VisualLayer.cpp b/src/VisualLayer.cpp index f3cc8b0..f1cb02e 100644 --- a/src/VisualLayer.cpp +++ b/src/VisualLayer.cpp @@ -43,7 +43,6 @@ void VisualLayer::set_scene_shader(ofShader scene_shader){ //-------------------------------------------------------------- void VisualLayer::update(){ - render_fbo.fbo.begin(); ofClear(0,0,0,0); if (use_shader) { @@ -60,8 +59,9 @@ void VisualLayer::update(){ scene_shader.end(); } else { player.update(); - player.draw(0, 0); + player.draw(0, 0, render_fbo.fbo.getWidth(), render_fbo.fbo.getHeight()); } + render_fbo.fbo.end(); } diff --git a/src/ofApp.cpp b/src/ofApp.cpp index 13fe4a3..c465a40 100755 --- a/src/ofApp.cpp +++ b/src/ofApp.cpp @@ -1,5 +1,6 @@ #include "ofApp.h" #include "nodel/nodel_dep.hpp" +#include "video_controller.h" #define STRINGIFY(A) #A @@ -473,6 +474,20 @@ void ofApp::keyPressed(int key){ cout << "Touch mode on" << endl; } break; + case 'v': + { + auto loader = video_controller::load(); + for (int i = 0; i < layers.size(); i++) { + auto l = layers[i]; + l->toggle_shader(); + if (!l->is_shader()) { + if (loader.has_next()) { + l->load_movie(loader.next()); + } + } + } + } + break; default: break; }