Ensure throw with incorrect use of SimplexStyle derivatives

This should ensure that in the case an implementation fails to correctly
check isDifferentiable then performs a subsequent derivative based sample,
an error is thrown, rather than potentially missing a logic bug due to
noise of 0 and derivative of 0 being returned which could otherwise be
hard to narrow down.
This commit is contained in:
Astrash
2024-10-09 20:45:25 +11:00
parent 9f425c6159
commit b4fa635455

View File

@@ -116,12 +116,12 @@ public abstract class SimplexStyleSampler extends DerivativeNoiseFunction {
@Override
public double[] getNoiseDerivativeRaw(long seed, double x, double y) {
return new double[]{ 0, 0, 0 };
throw new UnsupportedOperationException("Implementation failed to check or set isDifferentiable correctly");
}
@Override
public double[] getNoiseDerivativeRaw(long seed, double x, double y, double z) {
return new double[]{ 0, 0, 0, 0 };
throw new UnsupportedOperationException("Implementation failed to check or set isDifferentiable correctly");
}
@Override