summaryrefslogtreecommitdiffstats
path: root/src/system
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2019-08-01 13:31:06 +0300
committerMahmoud Badri <mahmoud.badri@qt.io>2019-08-01 13:35:43 +0300
commit3bcd2a4e81ffced186b060de8eee905b5c65f780 (patch)
tree404bb168ba6d1ed7f09ace958676f4539cb461d6 /src/system
parentd581af25b206411435de20a8c4f24f2ef7a74763 (diff)
Revert a bezier equation fix
Revert a fix for the bezier equation as it caused other issues. Task-number: QT3DS-704 Change-Id: I5bfc5bef62999e3e3949c7d90ef4db1e509e8782 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/system')
-rw-r--r--src/system/Qt3DSBezierEval.h11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/system/Qt3DSBezierEval.h b/src/system/Qt3DSBezierEval.h
index 46f8a3d..6435f2a 100644
--- a/src/system/Qt3DSBezierEval.h
+++ b/src/system/Qt3DSBezierEval.h
@@ -147,16 +147,7 @@ inline FLOAT EvaluateInverseBezierCurve(const FLOAT inP0, const FLOAT inP1, cons
}
} else {
INT32 theNumRoots = CCubicRoots::SolveCubic(theConstants, theSolution);
- INT32 solutionIndex = theNumRoots / 3;
- theResult = static_cast<FLOAT>(theSolution[solutionIndex]);
-
- // if the result is not within bounds, correct solutionIndex to pick the right solution
- // TODO: in rare situations the 3 solutions for the cubic equation are all invalid. It's
- // worth investigating.
- if (theResult <= 0)
- theResult = static_cast<FLOAT>(theSolution[solutionIndex - 1]);
- else if (theResult >= 1)
- theResult = static_cast<FLOAT>(theSolution[solutionIndex + 1]);
+ theResult = static_cast<FLOAT>(theSolution[theNumRoots / 3]);
}
return theResult;