summaryrefslogtreecommitdiffstats
path: root/src/demos/xtrans/InterpolatedVec3f.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-10-24 19:21:28 +0000
committerKenneth Russel <[email protected]>2005-10-24 19:21:28 +0000
commit6873f65775af236ed270fcbd08661f5b53ba3598 (patch)
tree6fcefdc3a9429d7d3071b1464c11d40fa7bc3ab9 /src/demos/xtrans/InterpolatedVec3f.java
parent538be101e7bce7788c82e1b254a66deb5d35bb56 (diff)
Merged JSR-231 branch on to the main JOGL trunk. The main trunk now
contains the evolving JSR-231 Reference Implementation and the JSR-231 branch is permanently closed. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@144 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/xtrans/InterpolatedVec3f.java')
-rwxr-xr-xsrc/demos/xtrans/InterpolatedVec3f.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/demos/xtrans/InterpolatedVec3f.java b/src/demos/xtrans/InterpolatedVec3f.java
new file mode 100755
index 0000000..28c3051
--- /dev/null
+++ b/src/demos/xtrans/InterpolatedVec3f.java
@@ -0,0 +1,37 @@
+package demos.xtrans;
+
+import gleem.linalg.*;
+
+/** A vector of three-dimensional floating-point values which
+ interpolates between specified start and end values. */
+
+public class InterpolatedVec3f {
+ private Vec3f start;
+ private Vec3f end;
+
+ /** Constructs a new InterpolatedQuad2f. By default both the start
+ and end quadrilaterals have all of their points set to the
+ origin. */
+ public InterpolatedVec3f() {
+ start = new Vec3f();
+ end = new Vec3f();
+ }
+
+ /** Returns the starting value for the interpolation. */
+ public Vec3f getStart() { return start; }
+
+ /** Sets the starting value for the interpolation. */
+ public void setStart(Vec3f vec) { start.set(vec); }
+
+ /** Returns the ending value for the interpolation. */
+ public Vec3f getEnd() { return end; }
+
+ /** Sets the ending value for the interpolation. */
+ public void setEnd(Vec3f vec) { end.set(vec); }
+
+ /** Gets the current interpolated value at the specified fraction of
+ interpolation (0.0 - 1.0). */
+ public Vec3f getCurrent(float fraction) {
+ return start.times(1.0f - fraction).plus(end.times(fraction));
+ }
+}