mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-27 14:30:23 +00:00
forgot you can add negative values
This commit is contained in:
1 parent
6d690d788b
commit
aab24c4303
1 file changed
+1
-1
+1
-1
@@ -333,7 +333,7 @@ public class PseudoErosionSampler implements NoiseSampler {
|
|||||||
} else if (lt < -1) {
|
} else if (lt < -1) {
|
||||||
return fastSqrt(pow2(x2dx) + pow2(y2dx)); // Distance between point 2 and position
|
return fastSqrt(pow2(x2dx) + pow2(y2dx)); // Distance between point 2 and position
|
||||||
} else {
|
} else {
|
||||||
double distance = (ldy * x1dx - ldx * y1dx) / fastSqrt(ldxSquared + ldySquared);
|
double distance = Math.fma(ldy, x1dx, (-(ldx * y1dx))) / fastSqrt(ldxSquared + ldySquared);
|
||||||
return fastAbs(distance); // Distance from the line
|
return fastAbs(distance); // Distance from the line
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user