plugins.engines
Class Perlin

java.lang.Object
  extended by Utilities.NoiseEngine
      extended by plugins.engines.Perlin
Direct Known Subclasses:
ModifiedMultiFractal, MultiFractal

public class Perlin
extends NoiseEngine

Author:
David

Field Summary
protected  double frequency
           
protected  int gridProjection
           
protected  NoiseType noiseType
           
protected  int octaves
           
protected  ExtendedHashBasedPanel panel
           
protected  double persistence
           
protected  double[] powerArray
           
 
Fields inherited from class Utilities.NoiseEngine
max, min, noiseArray, preview, previewNoise, scanlineSize, terrain, xGap
 
Constructor Summary
Perlin()
          Creates a new instance of perlin
 
Method Summary
 NoiseEngine copy()
           
 java.lang.String description()
           
 java.lang.String getDetails()
           
 double getNoiseForVertex(int vertex)
           
 double getNoiseForVertex(Vertex vertex)
           
 java.lang.String getNoiseName()
           
 Vertex getNoiseOffset()
           
 Vertex getNoiseSize()
           
 int getOctaves()
           
 javax.swing.JPanel getPanel()
           
 Vertex[] getPreviewVertices()
           
 double getScaledMovedNoiseForVertex(double x, double y, double z)
          Range 0 to 1 spans the width of the preview window.
 long getSeed()
           
 void initNoise()
           
 void load(java.io.ObjectInputStream file)
           
static void main(java.lang.String[] args)
           
 void makePreview()
           
 java.lang.String name()
           
 void restoreSettings()
           
 void save(java.io.ObjectOutputStream file)
           
 void setNoiseName(java.lang.String noiseName)
           
 void setNoiseSize(Vertex size)
           
 void setOctaves(int octaves)
           
 void setProjection(int projection)
           
 void setSeed(long seed)
           
 void setTerrain(Landscape terrain)
           
 void storeSettings()
           
protected  double Turbulence(double tmpX, double tmpY, double tmpZ, long octaves)
           
protected  double Turbulence(Vertex vert, long octaves)
           
 
Methods inherited from class Utilities.NoiseEngine
getMax, getMin, getPreviewNoise, getTerrain, getVertex, paintIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

panel

protected ExtendedHashBasedPanel panel

noiseType

protected NoiseType noiseType

gridProjection

protected int gridProjection

octaves

protected int octaves

persistence

protected double persistence

frequency

protected double frequency

powerArray

protected double[] powerArray
Constructor Detail

Perlin

public Perlin()
Creates a new instance of perlin

Method Detail

main

public static void main(java.lang.String[] args)

name

public java.lang.String name()
Specified by:
name in class NoiseEngine

description

public java.lang.String description()
Specified by:
description in class NoiseEngine

getPanel

public javax.swing.JPanel getPanel()
Specified by:
getPanel in class NoiseEngine

initNoise

public void initNoise()
Specified by:
initNoise in class NoiseEngine

Turbulence

protected double Turbulence(Vertex vert,
                            long octaves)

getNoiseForVertex

public double getNoiseForVertex(Vertex vertex)
Specified by:
getNoiseForVertex in class NoiseEngine

getScaledMovedNoiseForVertex

public double getScaledMovedNoiseForVertex(double x,
                                           double y,
                                           double z)
Description copied from class: NoiseEngine
Range 0 to 1 spans the width of the preview window.

Specified by:
getScaledMovedNoiseForVertex in class NoiseEngine
Returns:

getNoiseSize

public Vertex getNoiseSize()
Overrides:
getNoiseSize in class NoiseEngine

getNoiseOffset

public Vertex getNoiseOffset()
Overrides:
getNoiseOffset in class NoiseEngine

setProjection

public void setProjection(int projection)
Overrides:
setProjection in class NoiseEngine

getNoiseForVertex

public double getNoiseForVertex(int vertex)
Specified by:
getNoiseForVertex in class NoiseEngine

setTerrain

public void setTerrain(Landscape terrain)
Overrides:
setTerrain in class NoiseEngine

makePreview

public void makePreview()
Specified by:
makePreview in class NoiseEngine

storeSettings

public void storeSettings()
Specified by:
storeSettings in class NoiseEngine

restoreSettings

public void restoreSettings()
Specified by:
restoreSettings in class NoiseEngine

getPreviewVertices

public Vertex[] getPreviewVertices()
Overrides:
getPreviewVertices in class NoiseEngine

getSeed

public long getSeed()

setSeed

public void setSeed(long seed)

Turbulence

protected double Turbulence(double tmpX,
                            double tmpY,
                            double tmpZ,
                            long octaves)

save

public void save(java.io.ObjectOutputStream file)
          throws java.io.IOException
Specified by:
save in class NoiseEngine
Throws:
java.io.IOException

load

public void load(java.io.ObjectInputStream file)
          throws java.lang.ClassNotFoundException,
                 java.io.IOException
Specified by:
load in class NoiseEngine
Throws:
java.lang.ClassNotFoundException
java.io.IOException

copy

public NoiseEngine copy()
Specified by:
copy in class NoiseEngine

getDetails

public java.lang.String getDetails()
Specified by:
getDetails in class NoiseEngine

getNoiseName

public java.lang.String getNoiseName()

setNoiseName

public void setNoiseName(java.lang.String noiseName)

getOctaves

public int getOctaves()

setOctaves

public void setOctaves(int octaves)

setNoiseSize

public void setNoiseSize(Vertex size)