Skip to content

Commit

Permalink
Bugfix ofEasyCam (#6284)
Browse files Browse the repository at this point in the history
ofEasyCam stopped working for translate with mouse buttons - this fixes and makes sure left / middle / right and key modifiers all work for ofEasyCam

#changelog #3d
  • Loading branch information
ofTheo authored and arturoc committed Apr 27, 2019
1 parent 2c036d0 commit 29b4d63
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libs/openFrameworks/3d/ofEasyCam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ ofEasyCam::ofEasyCam(){
sensitivityTranslate = {1,1,1};
sensitivityRot = {1,1,1};

addInteraction(TRANSFORM_TRANSLATE_XY, OF_MOUSE_BUTTON_LEFT,doTranslationKey);
addInteraction(TRANSFORM_ROTATE, OF_MOUSE_BUTTON_LEFT);
addInteraction(TRANSFORM_TRANSLATE_XY, OF_MOUSE_BUTTON_LEFT,doTranslationKey);
addInteraction(TRANSFORM_TRANSLATE_Z, OF_MOUSE_BUTTON_RIGHT);
addInteraction(TRANSFORM_TRANSLATE_XY, OF_MOUSE_BUTTON_MIDDLE);

Expand Down Expand Up @@ -69,10 +69,10 @@ void ofEasyCam::reset(){

rot = {0,0,0};
translate = {0,0,0};

if(bAutoDistance){
bDistanceSet = false;
}
if(bAutoDistance){
bDistanceSet = false;
}
bApplyInertia = false;
currentTransformType = TRANSFORM_NONE;
}
Expand Down Expand Up @@ -377,7 +377,7 @@ void ofEasyCam::mousePressed(ofMouseEventArgs & mouse){
currentTransformType = TRANSFORM_NONE;
if (events) {
for (const auto& i: interactions) {
if (i.mouseButton == mouse.button && ((i.key == -1) ^ events->getKeyPressed(i.key))) {
if (i.mouseButton == mouse.button && ((i.key == -1) || events->getKeyPressed(i.key)) ) {
currentTransformType = i.transformType;
break;
}
Expand Down

0 comments on commit 29b4d63

Please sign in to comment.