openframeworks/openFrameworks — pull request #1227 by roymacdonald (2012-04-30 03:15:12+00:00)
Title: Rewritten ofEasyCam + minor fixes to ofNode

I completely rewrote ofEasyCam as it was working in some weird ways when the target was changed.
Now the maths are much simpler and tidier.
I also changed the way it is used.
Now by pressing the dragging the mouse with the left button the camera rotates around the target. when doing so with the right button the camera rotates around it's local z axis.

When the 'm' key is pressed, dragging the mouse with the left button will move the camera over it's local X an Y axes. Using the right button will move the camera over it's local z axis, making it "zoom" in or out.

In my initial implementation I checked if the mouse was inside a circle of radius min(ofGetWith, ofGetHeight) centered at the middle of the viewport, if it was inside the X and Y rotation was applied, else the Z rotation, thus leaving the second button free to use "zoom" in or out.
I finally decided to leave out this way of use opting for the one that I'm commiting.
If anyone of you thinks that my initial implementation would be better I can pull it.