1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-12-23 16:08:51 -05:00

Merge pull request #272 from PilzAdam/pow

Replace pow() with multiplikation to improve speed
This commit is contained in:
PilzAdam 2012-11-02 08:35:30 -07:00
commit 8adad36a66
2 changed files with 2 additions and 2 deletions

View File

@ -1228,7 +1228,7 @@ double base_rock_level_2d(u64 seed, v2s16 p)
0.5+(float)p.X/125., 0.5+(float)p.Y/125., 0.5+(float)p.X/125., 0.5+(float)p.Y/125.,
seed-932, 5, 0.7); seed-932, 5, 0.7);
b = rangelim(b, 0.0, 1000.0); b = rangelim(b, 0.0, 1000.0);
b = pow(b, 7); b = b*b*b*b*b*b*b;
b *= 5; b *= 5;
b = rangelim(b, 0.5, 1000.0); b = rangelim(b, 0.5, 1000.0);
// Values 1.5...100 give quite horrible looking slopes // Values 1.5...100 give quite horrible looking slopes

View File

@ -37,7 +37,7 @@ double dotProduct(double vx, double vy, double wx, double wy){
} }
double easeCurve(double t){ 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){ double linearInterpolation(double x0, double x1, double t){