Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

http://github.com/jdf/peasycam/issues/#issue/1

  • Loading branch information...
commit 29cbc3e6736fb57be1b64834e732ac7741313a88 1 parent b9c6dd2
@jdf authored
Showing with 25 additions and 7 deletions.
  1. +1 −1  .classpath
  2. +3 −3 resources/build.xml
  3. +21 −3 src/peasy/PeasyCam.java
View
2  .classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry combineaccessrules="false" kind="src" path="/processing-head"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Java 5"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/processing-core"/>
<classpathentry kind="output" path="bin"/>
</classpath>
View
6 resources/build.xml
@@ -4,7 +4,7 @@
PeasyCam build
</description>
- <property name="processing" location="c:/Documents and Settings/Administrator/Desktop/processing/processing-1.0.7/libraries" />
+ <property name="processing" location="c:/Documents and Settings/Administrator/Desktop/processing/processing-1.0.9/libraries" />
<property name="libraryClasspath" location="${processing}/../lib" />
<path id="library-classpath">
@@ -18,11 +18,11 @@
<property name="author" value="Jonathan Feinberg" />
<property name="copyright" value="(c) 2008" />
<property name="libraryName" value="PeasyCam" />
- <property name="versionNumber" value="0.8.1" />
+ <property name="versionNumber" value="0.8.2" />
<property name="yourLink" value="http://mrfeinberg.com" />
<property name="keywords" value="3D,camera,rotation" />
<property name="tested:platform" value="Windows" />
- <property name="tested:processingVersion" value="1.0.1" />
+ <property name="tested:processingVersion" value="1.0.9" />
<property name="tested:dependencies" value="" />
<property name="source:host" value="GitHub" />
<property name="source:url" value="http://github.com/jdf/peasycam/" />
View
24 src/peasy/PeasyCam.java
@@ -54,7 +54,8 @@
private double minimumDistance = 1;
private double maximumDistance = Double.MAX_VALUE;
- private final DampedAction rotateX, rotateY, rotateZ, dampedZoom;
+ private final DampedAction rotateX, rotateY, rotateZ, dampedZoom, dampedPanX,
+ dampedPanY;
private double distance;
private Vector3D center;
@@ -69,7 +70,8 @@
private final PeasyDragHandler panHandler /* ha ha ha */= new PeasyDragHandler() {
public void handleDrag(final double dx, final double dy)
{
- mousePan(dx, dy);
+ dampedPanX.impulse(dx / 8.);
+ dampedPanY.impulse(dy / 8.);
}
};
private PeasyDragHandler centerDragHandler = panHandler;
@@ -100,7 +102,7 @@ public void handleWheel(final int delta)
private final PMatrix3D originalMatrix = new PMatrix3D(); // for HUD restore
- public final String VERSION = "0.8.1";
+ public final String VERSION = "0.8.2";
public PeasyCam(final PApplet parent, final double distance)
{
@@ -150,6 +152,22 @@ protected void behave(final double velocity)
}
};
+ dampedPanX = new DampedAction(this) {
+ @Override
+ protected void behave(final double velocity)
+ {
+ mousePan(velocity, 0);
+ }
+ };
+
+ dampedPanY = new DampedAction(this) {
+ @Override
+ protected void behave(final double velocity)
+ {
+ mousePan(0, velocity);
+ }
+ };
+
final PeasyMouseListener mouseListener = new PeasyMouseListener();
p.registerMouseEvent(mouseListener);
p.registerKeyEvent(mouseListener);
Please sign in to comment.
Something went wrong with that request. Please try again.