C# Class fCraft.Noise

Class for generating and filtering 2D and 3D noise, extensively used by RealisticMapGenState and Cloudy brush.
Show file Open project: GlennMR/800craft Class Usage Examples

Public Properties

Property Type Description
InterpolationMode NoiseInterpolationMode
Seed int

Public Methods

Method Description
Add ( [ data1, [ data2 ) : void
ApplyBias ( [ data, float c00, float c01, float c10, float c11, float midpoint ) : void
Blend ( [ data1, [ data2, [ blendMap ) : void
BoxBlur ( [ heightmap ) : ].float[
CalculateCoverage ( [ data, int length, float threshold ) : float
CalculateNormalizationParams ( float map, float &multiplier, float &constant, float low, float high ) : void
CalculateSlope ( [ heightmap ) : ].float[
FindThreshold ( [ data, float desiredCoverage ) : float
GaussianBlur5X5 ( [ heightmap ) : ].float[
InterpolateCosine ( float v0, float v1, float x ) : float
InterpolateCosine ( float v00, float v01, float v10, float v11, float x, float y ) : float
InterpolateCubic ( float v0, float v1, float v2, float v3, float mu ) : float
InterpolateLinear ( float v0, float v1, float x ) : float
InterpolateLinear ( float v00, float v01, float v10, float v11, float x, float y ) : float
InterpolateSpline ( float v0, float v1, float v2, float v3, float mu ) : float
InterpolatedNoise ( float x, float y ) : float
InterpolatedNoise ( float x, float y, float z ) : float
Invert ( [ data ) : void
Marble ( [ map ) : void
Noise ( int seed, NoiseInterpolationMode interpolationMode ) : System
Normalize ( float map ) : void
Normalize ( float map, float &multiplier, float &constant ) : void
PerlinNoise ( float x, float y, float z, int startOctave, int endOctave, float decay ) : float
PerlinNoise ( float x, float y, int startOctave, int endOctave, float decay ) : float
PerlinNoise ( [ map, int startOctave, int endOctave, float decay, int offsetX, int offsetY ) : void
PerlinNoise ( [ map, int startOctave, int endOctave, float decay, int offsetX, int offsetY, int offsetZ ) : void
ScaleAndClip ( [ data, float steepness ) : void
StaticNoise ( int x, int y ) : float
StaticNoise ( int x, int y, int z ) : float

Private Methods

Method Description
Normalize ( float ptr, int length, float low, float high ) : void

Method Details

Add() public static method

public static Add ( [ data1, [ data2 ) : void
data1 [
data2 [
return void

ApplyBias() public static method

public static ApplyBias ( [ data, float c00, float c01, float c10, float c11, float midpoint ) : void
data [
c00 float
c01 float
c10 float
c11 float
midpoint float
return void

Blend() public static method

public static Blend ( [ data1, [ data2, [ blendMap ) : void
data1 [
data2 [
blendMap [
return void

BoxBlur() public static method

public static BoxBlur ( [ heightmap ) : ].float[
heightmap [
return ].float[

CalculateCoverage() public static method

public static CalculateCoverage ( [ data, int length, float threshold ) : float
data [
length int
threshold float
return float

CalculateNormalizationParams() public static method

public static CalculateNormalizationParams ( float map, float &multiplier, float &constant, float low, float high ) : void
map float
multiplier float
constant float
low float
high float
return void

CalculateSlope() public static method

public static CalculateSlope ( [ heightmap ) : ].float[
heightmap [
return ].float[

FindThreshold() public static method

public static FindThreshold ( [ data, float desiredCoverage ) : float
data [
desiredCoverage float
return float

GaussianBlur5X5() public static method

public static GaussianBlur5X5 ( [ heightmap ) : ].float[
heightmap [
return ].float[

InterpolateCosine() public static method

public static InterpolateCosine ( float v0, float v1, float x ) : float
v0 float
v1 float
x float
return float

InterpolateCosine() public static method

public static InterpolateCosine ( float v00, float v01, float v10, float v11, float x, float y ) : float
v00 float
v01 float
v10 float
v11 float
x float
y float
return float

InterpolateCubic() public static method

public static InterpolateCubic ( float v0, float v1, float v2, float v3, float mu ) : float
v0 float
v1 float
v2 float
v3 float
mu float
return float

InterpolateLinear() public static method

public static InterpolateLinear ( float v0, float v1, float x ) : float
v0 float
v1 float
x float
return float

InterpolateLinear() public static method

public static InterpolateLinear ( float v00, float v01, float v10, float v11, float x, float y ) : float
v00 float
v01 float
v10 float
v11 float
x float
y float
return float

InterpolateSpline() public static method

public static InterpolateSpline ( float v0, float v1, float v2, float v3, float mu ) : float
v0 float
v1 float
v2 float
v3 float
mu float
return float

InterpolatedNoise() public method

public InterpolatedNoise ( float x, float y ) : float
x float
y float
return float

InterpolatedNoise() public method

public InterpolatedNoise ( float x, float y, float z ) : float
x float
y float
z float
return float

Invert() public static method

public static Invert ( [ data ) : void
data [
return void

Marble() public static method

public static Marble ( [ map ) : void
map [
return void

Noise() public method

public Noise ( int seed, NoiseInterpolationMode interpolationMode ) : System
seed int
interpolationMode NoiseInterpolationMode
return System

Normalize() public static method

public static Normalize ( float map ) : void
map float
return void

Normalize() public static method

public static Normalize ( float map, float &multiplier, float &constant ) : void
map float
multiplier float
constant float
return void

PerlinNoise() public method

public PerlinNoise ( float x, float y, float z, int startOctave, int endOctave, float decay ) : float
x float
y float
z float
startOctave int
endOctave int
decay float
return float

PerlinNoise() public method

public PerlinNoise ( float x, float y, int startOctave, int endOctave, float decay ) : float
x float
y float
startOctave int
endOctave int
decay float
return float

PerlinNoise() public method

public PerlinNoise ( [ map, int startOctave, int endOctave, float decay, int offsetX, int offsetY ) : void
map [
startOctave int
endOctave int
decay float
offsetX int
offsetY int
return void

PerlinNoise() public method

public PerlinNoise ( [ map, int startOctave, int endOctave, float decay, int offsetX, int offsetY, int offsetZ ) : void
map [
startOctave int
endOctave int
decay float
offsetX int
offsetY int
offsetZ int
return void

ScaleAndClip() public static method

public static ScaleAndClip ( [ data, float steepness ) : void
data [
steepness float
return void

StaticNoise() public method

public StaticNoise ( int x, int y ) : float
x int
y int
return float

StaticNoise() public method

public StaticNoise ( int x, int y, int z ) : float
x int
y int
z int
return float

Property Details

InterpolationMode public property

public NoiseInterpolationMode InterpolationMode
return NoiseInterpolationMode

Seed public property

public int Seed
return int