summaryrefslogtreecommitdiff
path: root/src/noise.cpp
diff options
context:
space:
mode:
authorPilzAdam <adam-k@outlook.com>2012-11-02 16:24:57 +0100
committerPilzAdam <adam-k@outlook.com>2012-11-02 16:24:57 +0100
commitb701f8a878b7c76a33d7c3540a4b5e9c6e6b31ac (patch)
tree943645eba49c0f13be795a43cee560401a673d6b /src/noise.cpp
parent7fcf153adab121bfd50b246f32e074adab3a3b6d (diff)
downloadminetest-b701f8a878b7c76a33d7c3540a4b5e9c6e6b31ac.tar.gz
minetest-b701f8a878b7c76a33d7c3540a4b5e9c6e6b31ac.tar.bz2
minetest-b701f8a878b7c76a33d7c3540a4b5e9c6e6b31ac.zip
Replace pow() with multiplikation to improve speed
Diffstat (limited to 'src/noise.cpp')
-rw-r--r--src/noise.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/noise.cpp b/src/noise.cpp
index 4a7fc87e7..e75fbf4bd 100644
--- a/src/noise.cpp
+++ b/src/noise.cpp
@@ -37,7 +37,7 @@ double dotProduct(double vx, double vy, double wx, double wy){
}
double easeCurve(double t){
- return 6*pow(t,5)-15*pow(t,4)+10*pow(t,3);
+ return t * t * t * (6. * t * t - 15. * t + 10.);
}
double linearInterpolation(double x0, double x1, double t){