mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user