diff options
author | Kenneth Russel <[email protected]> | 2005-10-24 19:21:28 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-10-24 19:21:28 +0000 |
commit | 6873f65775af236ed270fcbd08661f5b53ba3598 (patch) | |
tree | 6fcefdc3a9429d7d3071b1464c11d40fa7bc3ab9 /src/demos/xtrans/InterpolatedFloat.java | |
parent | 538be101e7bce7788c82e1b254a66deb5d35bb56 (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/InterpolatedFloat.java')
-rwxr-xr-x | src/demos/xtrans/InterpolatedFloat.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/demos/xtrans/InterpolatedFloat.java b/src/demos/xtrans/InterpolatedFloat.java new file mode 100755 index 0000000..398e3b4 --- /dev/null +++ b/src/demos/xtrans/InterpolatedFloat.java @@ -0,0 +1,29 @@ +package demos.xtrans; + +import gleem.linalg.*; + +/** A floating-point value which interpolates between specified start + and end values. */ + +public class InterpolatedFloat { + private float start; + private float end; + + /** Returns the starting value for the interpolation. */ + public float getStart() { return start; } + + /** Sets the starting value for the interpolation. */ + public void setStart(float val) { start = val; } + + /** Returns the ending value for the interpolation. */ + public float getEnd() { return end; } + + /** Sets the ending value for the interpolation. */ + public void setEnd(float val) { end = val; } + + /** Gets the current interpolated value at the specified fraction of + interpolation (0.0 - 1.0). */ + public float getCurrent(float fraction) { + return (start * (1.0f - fraction)) + (end * fraction); + } +} |