Skip to content

Commit

Permalink
Add go.mod (#134)
Browse files Browse the repository at this point in the history
* Add go.mod

* Go 1.18 compatibility
  • Loading branch information
mpfrancis authored Apr 1, 2024
1 parent e545377 commit 722ddec
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
36 changes: 18 additions & 18 deletions Go/fastnoise.go
Original file line number Diff line number Diff line change
Expand Up @@ -682,34 +682,34 @@ func New[T Float]() *State[T] {
func (state *State[T]) apply() {
switch state.fractalType {
case FractalFBm:
state.noise2D = genFractalFBM2D
state.noise3D = genFractalFBM3D
state.noise2D = genFractalFBM2D[T]
state.noise3D = genFractalFBM3D[T]
case FractalRidged:
state.noise2D = genFractalRidged2D
state.noise3D = genFractalRidged3D
state.noise2D = genFractalRidged2D[T]
state.noise3D = genFractalRidged3D[T]
case FractalPingPong:
state.noise2D = genFractalPingPong2D
state.noise3D = genFractalPingPong3D
state.noise2D = genFractalPingPong2D[T]
state.noise3D = genFractalPingPong3D[T]
default:
switch state.noiseType {
case OpenSimplex2:
state.noise2D = singleSimplex2D
state.noise3D = singleOpenSimplex23D
state.noise2D = singleSimplex2D[T]
state.noise3D = singleOpenSimplex23D[T]
case OpenSimplex2S:
state.noise2D = singleOpenSimplex2S2D
state.noise3D = singleOpenSimplex2S3D
state.noise2D = singleOpenSimplex2S2D[T]
state.noise3D = singleOpenSimplex2S3D[T]
case Cellular:
state.noise2D = singleCellular2D
state.noise3D = singleCellular3D
state.noise2D = singleCellular2D[T]
state.noise3D = singleCellular3D[T]
case Perlin:
state.noise2D = singlePerlin2D
state.noise3D = singlePerlin3D
state.noise2D = singlePerlin2D[T]
state.noise3D = singlePerlin3D[T]
case ValueCubic:
state.noise2D = singleValueCubic2D
state.noise3D = singleValueCubic3D
state.noise2D = singleValueCubic2D[T]
state.noise3D = singleValueCubic3D[T]
case Value:
state.noise2D = singleValue2D
state.noise3D = singleValue3D
state.noise2D = singleValue2D[T]
state.noise3D = singleValue3D[T]
default:
state.noise2D = func(_ *State[T], _ int, _, _ T) T { return 0 }
state.noise3D = func(_ *State[T], _ int, _, _, _ T) T { return 0 }
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/Auburn/FastNoiseLite

go 1.18

0 comments on commit 722ddec

Please sign in to comment.