Permalink
Browse files

document wheelScale()

  • Loading branch information...
jdf committed Sep 3, 2010
1 parent 8e5143e commit 31bcd091ee989aa90128ee8425e52ed6126309e6
Showing with 82 additions and 74 deletions.
  1. +78 −74 README.textile
  2. +4 −0 web/index.html
View
@@ -1,74 +1,78 @@
-PeasyCam provides a dead-simple mouse-driven camera for Processing. It is created and maintained by "Jonathan Feinberg":http://mrfeinberg.com/. It is free for all uses, per the Apache 2.0 license.
-
-To download the distribution, and to see a demo, go to "the PeasyCam home page":http://mrfeinberg.com/peasycam/.
-
-h3. Example
-
-<pre>PeasyCam camera;
-
-void setup() {
- // PeasyCam constructor:
- // PeasyCam(PApplet parent,
- // double lookAtX, double lookAtY, double lookAtZ,
- // double distance);
- camera = new PeasyCam(this, 0, 0, 0, 50);
-}</pre>
-
-That's it. Now a mouse left-drag will rotate the camera around the subject, a right drag will zoom in and out, and a middle-drag will pan. A double-click restores the camera to its original position.
-
-The PeasyCam is positioned on a sphere whose radius is the given distance from the look-at point. Rotations are around axes that pass through the looked-at point.
-
-h3. Constructors
-
-<pre>PeasyCam(PApplet parent, double lookAtX, double lookAtY, double lookAtZ, double distance);
-PeasyCam(PApplet parent, double distance); // look at 0,0,0</pre>
-
-h3. Methods
-
-<pre>camera.setMouseControlled(boolean isMouseControlled); // default true
-
-// reassign particular drag gestures, or set them to null
-camera.setLeftDragHandler(PeasyDragHandler handler);
-camera.setCenterDragHandler(PeasyDragHandler handler);
-camera.setRightDragHandler(PeasyDragHandler handler);
-PeasyDragHandler getPanDragHandler();
-PeasyDragHandler getRotateDragHandler();
-PeasyDragHandler getZoomDragHandler();
-
-// mouse wheel zooms by default; set null, or make your own
-camera.setWheelHandler(PeasyWheelHandler handler);
-PeasyWheelHandler getZoomWheelHandler();
-
-// make your own!
-public interface PeasyDragHandler {
- public void handleDrag(final double dx, final double dy);
-}
-public interface PeasyWheelHandler {
- public void handleWheel(final int delta);
-}
-
-camera.lookAt(double x, double y, double z);
-camera.rotateX(double angle); // rotate around the x-axis passing through the subject
-camera.rotateY(double angle); // rotate around the y-axis passing through the subject
-camera.rotateZ(double angle); // rotate around the z-axis passing through the subject
-camera.setDistance(double d); // distance from looked-at point
-camera.pan(double dx, double dy); // move the looked-at point relative to current orientation
-
-camera.reset();
-camera.reset(long animationTimeInMillis); // reset camera to its starting settings
-
-CameraState state = camera.getState(); // get a serializable settings object for current state
-camera.setState(CameraState state);
-camera.setState(CameraState state, long animationTimeInMillis); // set the camera to the given saved state
-
-// Utility methods to permit the use of a Heads-Up Display
-// Thanks, A.W. Martin
-camera.beginHUD();
-// now draw things that you want relative to the camera's position and orientation
-camera.endHUD(); // always!</pre>
-
-PeasyCam is impervious to gimbal lock, and has no known "singularities" or discontinuities in its behavior. It relies on the excellent "Apache Commons Math":http://commons.apache.org/math/ "geometry package":http://commons.apache.org/math/userguide/geometry.html for its rotations.
-
-h3. Contributors
-
-Thanks: "Oori Shalev":http://ooish.com/, Jeffrey Gentes, "A.W. Martin":http://imaginationfeed.com, "Yiannis Chatzikonstantinou":http://prototy.blogspot.com/, and "Donald Ephraim Curtis":http://milkbox.net/ for bug reports and feature suggestions.
+PeasyCam provides a dead-simple mouse-driven camera for Processing. It is created and maintained by "Jonathan Feinberg":http://mrfeinberg.com/. It is free for all uses, per the Apache 2.0 license.
+
+To download the distribution, and to see a demo, go to "the PeasyCam home page":http://mrfeinberg.com/peasycam/.
+
+h3. Example
+
+<pre>PeasyCam camera;
+
+void setup() {
+ // PeasyCam constructor:
+ // PeasyCam(PApplet parent,
+ // double lookAtX, double lookAtY, double lookAtZ,
+ // double distance);
+ camera = new PeasyCam(this, 0, 0, 0, 50);
+}</pre>
+
+That's it. Now a mouse left-drag will rotate the camera around the subject, a right drag will zoom in and out, and a middle-drag will pan. A double-click restores the camera to its original position.
+
+The PeasyCam is positioned on a sphere whose radius is the given distance from the look-at point. Rotations are around axes that pass through the looked-at point.
+
+h3. Constructors
+
+<pre>PeasyCam(PApplet parent, double lookAtX, double lookAtY, double lookAtZ, double distance);
+PeasyCam(PApplet parent, double distance); // look at 0,0,0</pre>
+
+h3. Methods
+
+<pre>camera.setMouseControlled(boolean isMouseControlled); // default true
+
+// reassign particular drag gestures, or set them to null
+camera.setLeftDragHandler(PeasyDragHandler handler);
+camera.setCenterDragHandler(PeasyDragHandler handler);
+camera.setRightDragHandler(PeasyDragHandler handler);
+PeasyDragHandler getPanDragHandler();
+PeasyDragHandler getRotateDragHandler();
+PeasyDragHandler getZoomDragHandler();
+
+// mouse wheel zooms by default; set null, or make your own
+camera.setWheelHandler(PeasyWheelHandler handler);
+PeasyWheelHandler getZoomWheelHandler();
+
+// change sensitivity of built-in mouse wheel zoom
+camera.setWheelScale(double scale); // 1.0 by default
+double getWheelScale();
+
+// make your own!
+public interface PeasyDragHandler {
+ public void handleDrag(final double dx, final double dy);
+}
+public interface PeasyWheelHandler {
+ public void handleWheel(final int delta);
+}
+
+camera.lookAt(double x, double y, double z);
+camera.rotateX(double angle); // rotate around the x-axis passing through the subject
+camera.rotateY(double angle); // rotate around the y-axis passing through the subject
+camera.rotateZ(double angle); // rotate around the z-axis passing through the subject
+camera.setDistance(double d); // distance from looked-at point
+camera.pan(double dx, double dy); // move the looked-at point relative to current orientation
+
+camera.reset();
+camera.reset(long animationTimeInMillis); // reset camera to its starting settings
+
+CameraState state = camera.getState(); // get a serializable settings object for current state
+camera.setState(CameraState state);
+camera.setState(CameraState state, long animationTimeInMillis); // set the camera to the given saved state
+
+// Utility methods to permit the use of a Heads-Up Display
+// Thanks, A.W. Martin
+camera.beginHUD();
+// now draw things that you want relative to the camera's position and orientation
+camera.endHUD(); // always!</pre>
+
+PeasyCam is impervious to gimbal lock, and has no known "singularities" or discontinuities in its behavior. It relies on the excellent "Apache Commons Math":http://commons.apache.org/math/ "geometry package":http://commons.apache.org/math/userguide/geometry.html for its rotations.
+
+h3. Contributors
+
+Thanks: "Oori Shalev":http://ooish.com/, Jeffrey Gentes, "A.W. Martin":http://imaginationfeed.com, "Yiannis Chatzikonstantinou":http://prototy.blogspot.com/, and "Donald Ephraim Curtis":http://milkbox.net/ for bug reports and feature suggestions.
View
@@ -214,6 +214,10 @@ <h3>Methods</h3>
camera.setWheelHandler(PeasyWheelHandler handler);
PeasyWheelHandler getZoomWheelHandler();
+// change sensitivity of built-in mouse wheel zoom
+camera.setWheelScale(double scale); // 1.0 by default
+double getWheelScale();
+
// make your own!
public interface PeasyDragHandler {
public void handleDrag(final double dx, final double dy);

0 comments on commit 31bcd09

Please sign in to comment.