Skip to content

Commit

Permalink
i hate precision loss
Browse files Browse the repository at this point in the history
  • Loading branch information
OGDemonZ committed Dec 25, 2024
1 parent 225741c commit bda1710
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extensions/Corbnorb/noise.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
switch (this._NoiseType) {
case FastNoiseLite.NoiseType.OpenSimplex2:
case FastNoiseLite.NoiseType.OpenSimplex2S: {
const SQRT3 = 1.7320508075688772935274463415059;
const SQRT3 = 1.7320508075688772;
const F2 = 0.5 * (SQRT3 - 1);
let t = (x + y) * F2;
x += t;
Expand Down Expand Up @@ -1131,7 +1131,7 @@
* @returns {number}
*/
_SingleOpenSimplex2R2(seed, x, y) {
const SQRT3 = 1.7320508075688772935274463415059;
const SQRT3 = 1.7320508075688772;
const G2 = (3 - SQRT3) / 6;

let i = Math.floor(x);
Expand Down Expand Up @@ -2724,7 +2724,7 @@
switch (this._DomainWarpType) {
case FastNoiseLite.DomainWarpType.OpenSimplex2:
case FastNoiseLite.DomainWarpType.OpenSimplex2Reduced: {
const SQRT3 = 1.7320508075688772935274463415059;
const SQRT3 = 1.7320508075688772;
const F2 = 0.5 * (SQRT3 - 1);
let t = (xs + ys) * F2;
xs += t;
Expand Down

0 comments on commit bda1710

Please sign in to comment.