class Noise

Overview

Module for generating n dimensions perlin like noise

Direct Known Subclasses

Defined in:

noise.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(periods : Indexable(UInt32 | Nil), frequencies = Slice(Float64 | ::Nil).empty, offsets = Slice(Float64 | ::Nil).empty, intensity_multiplier : Float64 = 1.0, intensity_gain : Float64 = 0.0) #

Initialize a periodic noise. It must be the root noise to be periodic.


[View source]
def self.new(frequencies = Slice(Float64 | ::Nil).empty, offsets = Slice(Float64 | ::Nil).empty, intensity_multiplier : Float64 = 1.0, intensity_gain : Float64 = 0.0, child : Noise | Nil = nil) #

Initialize a non-periodic noise. It can be a root noise ot just parameters added on top of another noise.


[View source]

Instance Method Detail

def *(other : Float64) : Noise #

[View source]
def *(other : Noise) : Noise #

[View source]
def +(other : Float64) : Noise #

[View source]
def +(other : Noise) : Noise #

[View source]
def + : Noise #

[View source]
def -(other : Float64) : Noise #

[View source]
def -(other : Noise) : Noise #

[View source]
def - : Noise #

[View source]
def /(other : Float64) : Noise #

[View source]
def /(other : Noise) : Noise #

[View source]
def [](*coordinates : Float64) : Float64 #

[View source]
def gradients(coordinates : Indexable(Int32)) : Indexable(Float64) #

[View source]
def interpolate(a0 : Float64, a1 : Float64, w : Float64) #

Simple smootherstep interpolation function


[View source]
def raw(*coordinates : Float64) #

Generate noise value for the given coordinates and gradients


[View source]