move Sampler to util package

This commit is contained in:
dfsek committed 2021-09-24 12:18:57 -07:00
1 parent a7d0e7f49b
commit 988579b708
11 files changed
+10 -8

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
dependencies {
"shadedApi"("net.jafama:jafama:2.3.2")
}
@@ -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);
}
}