move Sampler to util package

This commit is contained in:
dfsek
2021-09-24 12:18:57 -07:00
parent a7d0e7f49b
commit 988579b708
11 changed files with 10 additions and 8 deletions

View File

@@ -1,3 +1,4 @@
dependencies {
"shadedApi"("net.jafama:jafama:2.3.2")
}

View File

@@ -0,0 +1,12 @@
package com.dfsek.terra.api.util.math;
@FunctionalInterface
public interface Sampler {
double sample(double x, double y, double z);
default double sample(int x, int y,
int z) { // Floating-point modulus operations are expensive. This allows implementations to optionally handle
// integers separately.
return sample((double) x, y, z);
}
}