Skip to content

Commit

Permalink
Merge branch 'Tweak-Arcball-Integration'
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyegan committed Oct 27, 2014
2 parents 6bd29e4 + cfb616a commit 938d2df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions ArcBall.pde
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,24 @@ public class ArcBall implements PConstants{
public void dragEnd() {
dragging = false;
}



/**
* Update currentRotation with data from dragging
*/
public void update(){
if( dragging ) {
currentRotation = quaternion.mult(deltaRotation, startRotation);

if(frameCount % 3 == 0) {
startRotation.set(currentRotation);
deltaRotation.setToIdentity();
startPoint.set(endPoint);
}
} else {
currentRotation = quaternion.mult(deltaRotation, currentRotation);
deltaRotation = deltaRotation.power(0.9f);
deltaRotation = deltaRotation.power(0.999f);
}

applyRotation(currentRotation);

applyRotation(currentRotation);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion sketch3d.pde
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ void mousePressed() {
}

void mouseDragged() {
arcBall.dragging(mouseX, mouseY);
//arcBall.dragging(mouseX, mouseY);
}

void mouseReleased() {
Expand Down

0 comments on commit 938d2df

Please sign in to comment.