Use the lerp header to pull in the correct lerp
This commit is contained in:
parent
9c63070718
commit
f009e96b91
20
perlin.cpp
20
perlin.cpp
@ -1,5 +1,6 @@
|
|||||||
#include "perlin.hpp"
|
#include "perlin.hpp"
|
||||||
|
|
||||||
|
#include "lerp.hpp"
|
||||||
#include "debug.hpp"
|
#include "debug.hpp"
|
||||||
#include "maths.hpp"
|
#include "maths.hpp"
|
||||||
|
|
||||||
@ -7,25 +8,6 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
|
|
||||||
namespace lerp {
|
|
||||||
double
|
|
||||||
linear (double a, double b, double weight) {
|
|
||||||
check (weight >= 0 && weight <= 1.0);
|
|
||||||
return (1.0 - weight) * a + weight * b;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
double
|
|
||||||
cosine (double a, double b, double weight) {
|
|
||||||
check (weight >= 0 && weight <= 1.0);
|
|
||||||
double ft = weight * PI;
|
|
||||||
double f = (1.0 - cos (ft)) * 0.5;
|
|
||||||
|
|
||||||
return a * (1.0 - f) + b * f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Just a random generator [-1.0, 1.0]
|
// Just a random generator [-1.0, 1.0]
|
||||||
static float
|
static float
|
||||||
generate (intmax_t x, intmax_t y) {
|
generate (intmax_t x, intmax_t y) {
|
||||||
|
Loading…
Reference in New Issue
Block a user