some noise tweaks

This commit is contained in:
darkrose 2014-03-08 14:28:49 +10:00
parent 507401cd2a
commit 2c849c9b36
2 changed files with 5 additions and 7 deletions

View File

@ -32,15 +32,11 @@ double cos_lookup[16] = {
1.0,-0.9238,-0.7071,-0.3826,0,0.3826,0.7071,0.9238
};
double dotProduct(double vx, double vy, double wx, double wy){
inline double dotProduct(double vx, double vy, double wx, double wy){
return vx*wx+vy*wy;
}
double easeCurve(double t){
return 6*pow(t,5)-15*pow(t,4)+10*pow(t,3);
}
double linearInterpolation(double x0, double x1, double t){
inline double linearInterpolation(double x0, double x1, double t){
return x0+(x1-x0)*t;
}

View File

@ -59,7 +59,9 @@ private:
int m_next;
};
double easeCurve(double t);
inline double easeCurve(double t){
return t * t * t * (6. * t * t - 15. * t + 10.);
}
// Return value: -1 ... 1
double noise2d(int x, int y, int seed);