Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add getDistance() and getLookAt()

  • Loading branch information...
commit 6a18f219935c53b66ed0521fa412188edcc6f316 1 parent f02232d
@jdf authored
Showing with 16 additions and 1 deletion.
  1. +1 −1  resources/build.xml
  2. +11 −0 src/peasy/PeasyCam.java
  3. +4 −0 web/index.html
View
2  resources/build.xml
@@ -18,7 +18,7 @@
<property name="author" value="Jonathan Feinberg" />
<property name="copyright" value="(c) 2008" />
<property name="libraryName" value="PeasyCam" />
- <property name="versionNumber" value="0.5.0" />
+ <property name="versionNumber" value="0.5.1" />
<property name="yourLink" value="http://mrfeinberg.com" />
<property name="keywords" value="3D,camera,rotation" />
<property name="tested:platform" value="Windows" />
View
11 src/peasy/PeasyCam.java
@@ -238,6 +238,11 @@ private void mouseRotate(final double dx, final double dy)
}
}
+ public double getDistance()
+ {
+ return distance;
+ }
+
public void setDistance(final double newDistance)
{
setDistance(newDistance, 300);
@@ -249,6 +254,12 @@ public void setDistance(final double newDistance, final long animationTimeMillis
animationTimeMillis));
}
+ public float[] getLookAt()
+ {
+ return new float[] { (float) center.getX(), (float) center.getY(),
+ (float) center.getZ() };
+ }
+
public void lookAt(final double x, final double y, final double z)
{
centerInterps.startInterpolation(new CenterInterp(new Vector3D(x, y, z), 300));
View
4 web/index.html
@@ -169,6 +169,7 @@
<p>Useful bug reports and feature suggestions were provided by:</p>
<ul>
<li><a href="http://ooish.com/">Oori Shalev</a></li>
+<li>Jeffrey Gentes</li>
</ul>
<p>Please let me know if I've forgotten to acknowledge you.</p>
@@ -205,6 +206,9 @@
camera.setDistance(double d); // distance from looked-at point
camera.pan(double dx, double dy); // move the looked-at point relative to current orientation
+double camera.getDistance(); // current distance
+float[] camera.getLookAt(); // float[] { x, y, z }, looked-at point
+
camera.setMinimumDistance(double minimumDistance);
camera.setMaximumDistance(double maximumDistance); // clamp zooming
Please sign in to comment.
Something went wrong with that request. Please try again.