automated snapshot

This commit is contained in:
sumi
2025-12-17 23:54:25 -06:00
parent 66df6a29ff
commit 57ad5d0d5e
3 changed files with 141 additions and 48 deletions

33
field.go Normal file
View File

@@ -0,0 +1,33 @@
package main
import (
"github.com/ojrac/opensimplex-go"
)
type Field interface {
/**
* return a value on the range 0,1
*/
Get(x float32, y float32) float32
}
// TRANSFORM FIELDS
type ScaleField struct {
Scale float32
Field Field
}
func (f *ScaleField) Get(x, y float32) float32 {
return f.Field.Get(x / f.Scale, y / f.Scale)
}
// NOISE FIELDS
type SimplexNoiseField struct {
Noise opensimplex.Noise32
}
func (f *SimplexNoiseField) Get(x, y float32) float32 {
return f.Noise.Eval2(x, y)
}