RulePerlin
ldtk.rules.RulePerlin (Class)
2D Perlin noise, ported from hxd.Perlin of the Heaps engine (MIT license, Copyright (c) 2013 Nicolas Cannasse).
Only the parts used by the LDtk rule engine are kept. The integer index hash uses 32 bit arithmetic so that
every target produces the same values; the rest is plain IEEE double arithmetic.
Static Members
forRules(): RulePerlinThe configuration used by LDtk auto-layer rules
| Returns |
|---|
| RulePerlin |
Instance Members
repeat: Intnormalize: BoolKeep result in the [-1, 1] range
| Name | Type |
|---|---|
size |
Int |
scale |
Float |
| Returns |
|---|
| Float |
| Name | Type |
|---|---|
seed |
Int |
x |
Float |
y |
Float |
| Returns |
|---|
| Float |
perlin(seed: Int, x: Float, y: Float, octaves: Int, ?persist: Float = 0.5, ?lacunarity: Float = 2.0): Float| Name | Type | Default |
|---|---|---|
seed |
Int | |
x |
Float | |
y |
Float | |
octaves |
Int | |
persist |
Float | 0.5 |
lacunarity |
Float | 2.0 |
| Returns |
|---|
| Float |
new(): VoidPrivate Members
NGRADS: Int| Name | Type |
|---|---|
a |
Float |
| Returns |
|---|
| Float |
| Name | Type |
|---|---|
a |
Float |
b |
Float |
k |
Float |
| Returns |
|---|
| Float |
| Name | Type |
|---|---|
x |
Float |
y |
Float |
ix |
Int |
iy |
Int |
seed |
Int |
| Returns |
|---|
| Float |