| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Game.TCOD.Noise
- newtype TCODNoise = TCODNoise {
- unTCODNoise :: Ptr ()
- data TCODNoiseType
- noiseMaxOctaves :: Int
- noiseMaxDimensions :: Int
- noiseDefaultHurst :: Double
- noiseDefaultLacunarity :: Double
- noiseNew :: Int -> Double -> Double -> TCODRandom -> IO TCODNoise
- noiseDelete :: TCODNoise -> IO ()
- noiseSetType :: TCODNoise -> TCODNoiseType -> IO ()
- noiseGetEx :: TCODNoise -> Vector Double -> TCODNoiseType -> IO Double
- noiseGetFbmEx :: TCODNoise -> Vector Double -> Float -> TCODNoiseType -> IO Float
- noiseGetTurbulenceEx :: TCODNoise -> Vector Double -> Float -> TCODNoiseType -> IO Float
- noiseGet :: TCODNoise -> Vector Double -> IO Double
- noiseGetFbm :: TCODNoise -> Vector Double -> Float -> IO Float
- noiseGetTurbulence :: TCODNoise -> Vector Double -> Float -> IO Float
Documentation
Reference to TCOD noise object
Constructors
| TCODNoise | |
Fields
| |
data TCODNoiseType Source #
Supported noise generator types
Constructors
| NoiseDefault | |
| NoisePerlin | |
| NoiseSimplex | |
| NoiseWavelet |
Arguments
| :: Int | Dimensions |
| -> Double | hurst |
| -> Double | lacunarity |
| -> TCODRandom | random number generator |
| -> IO TCODNoise |
Create a new noise object
noiseDelete :: TCODNoise -> IO () Source #
Delete noise object
noiseSetType :: TCODNoise -> TCODNoiseType -> IO () Source #
Choosing a noise type
Use this function to define the default algorithm used by the noise functions. The default algorithm is simplex. It's much faster than Perlin, especially in 4 dimensions. It has a better contrast too.
Arguments
| :: TCODNoise | the generator handler, returned by the initialization function. |
| -> Vector Double | An array of coordinates, depending on the generator dimensions (between 1 and 4). The same array of coordinates will always return the same value. |
| -> TCODNoiseType | The algorithm to use. If not defined, use the default one (set with setType or simplex if not set) |
| -> IO Double |
Getting flat noise
his function returns the noise function value between -1.0 and 1.0 at given coordinates.
Arguments
| :: TCODNoise | the generator handler, returned by the initialization function. |
| -> Vector Double | An array of coordinates, depending on the generator dimensions (between 1 and 4). The same array of coordinates will always return the same value. |
| -> Float | Number of iterations. Must be < TCOD_NOISE_MAX_OCTAVES = 128 |
| -> TCODNoiseType | The algorithm to use |
| -> IO Float |
This function returns the fbm function value between -1.0 and 1.0 at given coordinates, using fractal hurst and lacunarity defined when the generator has been created.
Arguments
| :: TCODNoise | the generator handler, returned by the initialization function. |
| -> Vector Double | An array of coordinates, depending on the generator dimensions (between 1 and 4). The same array of coordinates will always return the same value. |
| -> Float | Number of iterations. Must be < TCOD_NOISE_MAX_OCTAVES = 128 |
| -> TCODNoiseType | The algorithm to use |
| -> IO Float |
Getting turbulence
This function returns the turbulence function value between -1.0 and 1.0 at given coordinates, using fractal hurst and lacunarity defined when the generator has been created.
Arguments
| :: TCODNoise | the generator handler, returned by the initialization function. |
| -> Vector Double | An array of coordinates, depending on the generator dimensions (between 1 and 4). The same array of coordinates will always return the same value. |
| -> IO Double |
Getting flat noise
his function returns the noise function value between -1.0 and 1.0 at given coordinates.
Arguments
| :: TCODNoise | the generator handler, returned by the initialization function. |
| -> Vector Double | An array of coordinates, depending on the generator dimensions (between 1 and 4). The same array of coordinates will always return the same value. |
| -> Float | Number of iterations. Must be < TCOD_NOISE_MAX_OCTAVES = 128 |
| -> IO Float |
This function returns the fbm function value between -1.0 and 1.0 at given coordinates, using fractal hurst and lacunarity defined when the generator has been created.
Arguments
| :: TCODNoise | the generator handler, returned by the initialization function. |
| -> Vector Double | An array of coordinates, depending on the generator dimensions (between 1 and 4). The same array of coordinates will always return the same value. |
| -> Float | Number of iterations. Must be < TCOD_NOISE_MAX_OCTAVES = 128 |
| -> IO Float |
Getting turbulence
This function returns the turbulence function value between -1.0 and 1.0 at given coordinates, using fractal hurst and lacunarity defined when the generator has been created.