automated snapshot
This commit is contained in:
14
field.go
14
field.go
@@ -124,9 +124,21 @@ func (fl *FieldLayer) IsDirty() bool {
|
||||
return fl.dirty
|
||||
}
|
||||
|
||||
type AdderField struct {
|
||||
fields []Field
|
||||
}
|
||||
|
||||
func (f *AdderField) Get(x, y float32) float32 {
|
||||
var z float32 = 0.0
|
||||
for _, field := range f.fields {
|
||||
z += rl.Clamp(field.Get(x, y), 0.0, 1.0) / float32(len(f.fields))
|
||||
}
|
||||
return z
|
||||
}
|
||||
|
||||
type SinXYField struct {}
|
||||
|
||||
func (f *SinXYField) Get(x, y float32) float32 {
|
||||
return float32(math.Sin(float64(x * y)))
|
||||
return float32(0.5 + 0.5*math.Sin(float64(x))*math.Sin(float64(y)))
|
||||
//return float32(math.Sin(float64(x * y)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user