Skip to content

Commit

Permalink
ofEasyCam: setPosition actually sets the position no matter what othe…
Browse files Browse the repository at this point in the history
…r settings (#6265)

#changelog #3d
  • Loading branch information
roymacdonald authored and arturoc committed Apr 1, 2019
1 parent 521d763 commit 2b2cc13
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libs/openFrameworks/3d/ofEasyCam.cpp
Original file line number Diff line number Diff line change
@@ -70,6 +70,9 @@ void ofEasyCam::reset(){
rot = {0,0,0};
translate = {0,0,0};

if(bAutoDistance){
bDistanceSet = false;
}
bApplyInertia = false;
currentTransformType = TRANSFORM_NONE;
}
@@ -507,3 +510,9 @@ bool ofEasyCam:: hasInteraction(TransformType type, int mouseButton, int key){
void ofEasyCam::removeAllInteractions(){
interactions.clear();
}
//----------------------------------------
void ofEasyCam::onPositionChanged(){
if(!bDistanceSet && bAutoDistance){
bDistanceSet = true;
}
}
2 changes: 2 additions & 0 deletions libs/openFrameworks/3d/ofEasyCam.h
Original file line number Diff line number Diff line change
@@ -178,6 +178,8 @@ class ofEasyCam : public ofCamera {
bool hasInteraction(TransformType type, int mouseButton, int key = -1);
bool hasInteraction(int mouseButton, int key);
void removeAllInteractions();
protected:
virtual void onPositionChanged() ;
private:
void setDistance(float distance, bool save);

0 comments on commit 2b2cc13

Please sign in to comment.