From fbb396b8a2a40972d7bf266479b06e8ddd0a842e Mon Sep 17 00:00:00 2001 From: "dan..om" Date: Wed, 9 Nov 2011 04:01:21 +0000 Subject: [PATCH] * Fixed extrapolateLinear() so it would really extrapolates if bigger than 1 or smaller than 0. The old behavior was to clamp between 0 and 1, doing exactly the same thing as interpolateLinear(). git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8616 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/math/FastMath.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/engine/src/core/com/jme3/math/FastMath.java b/engine/src/core/com/jme3/math/FastMath.java index becfdd198..b53c8bf18 100644 --- a/engine/src/core/com/jme3/math/FastMath.java +++ b/engine/src/core/com/jme3/math/FastMath.java @@ -166,9 +166,9 @@ final public class FastMath { * @return an extrapolation for the given parameters */ public static float extrapolateLinear(float scale, float startValue, float endValue) { - if (scale <= 0f) { - return startValue; - } +// if (scale <= 0f) { +// return startValue; +// } return ((1f - scale) * startValue) + (scale * endValue); } @@ -187,9 +187,9 @@ final public class FastMath { if (store == null) { store = new Vector3f(); } - if (scale <= 1f) { - return interpolateLinear(scale, startValue, endValue, store); - } +// if (scale <= 1f) { +// return interpolateLinear(scale, startValue, endValue, store); +// } store.x = extrapolateLinear(scale, startValue.x, endValue.x); store.y = extrapolateLinear(scale, startValue.y, endValue.y); store.z = extrapolateLinear(scale, startValue.z, endValue.z);