propane 3.8.0-java → 4.0.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.mvn/extensions.xml +1 -1
- data/.mvn/wrapper/maven-wrapper.properties +1 -1
- data/.travis.yml +1 -1
- data/CHANGELOG.md +7 -1
- data/README.md +7 -7
- data/Rakefile +6 -5
- data/lib/propane/app.rb +10 -17
- data/lib/propane/helper_methods.rb +6 -6
- data/lib/propane/version.rb +1 -1
- data/lib/propane-4.0.0.jar +0 -0
- data/library/pdf/itextpdf-5.5.13.2.jar +0 -0
- data/library/pdf/pdf.rb +7 -0
- data/library/slider/slider.rb +1 -1
- data/library/svg/batik-all-1.14.jar +0 -0
- data/library/svg/svg.rb +7 -0
- data/mvnw +3 -3
- data/mvnw.cmd +2 -2
- data/pom.rb +35 -8
- data/pom.xml +60 -9
- data/propane.gemspec +9 -7
- data/src/main/java/monkstone/ColorUtil.java +1 -1
- data/src/main/java/monkstone/FastNoiseModuleJava.java +127 -0
- data/src/main/java/monkstone/MathToolModule.java +31 -31
- data/src/main/java/monkstone/PropaneLibrary.java +3 -1
- data/src/main/java/monkstone/SmoothNoiseModuleJava.java +127 -0
- data/src/main/java/monkstone/fastmath/DegLutTables.java +25 -26
- data/src/main/java/monkstone/fastmath/Deglut.java +1 -1
- data/src/main/java/monkstone/filechooser/Chooser.java +2 -2
- data/src/main/java/monkstone/noise/LICENSE +121 -0
- data/src/main/java/monkstone/noise/OpenSimplex2F.java +914 -0
- data/src/main/java/monkstone/noise/OpenSimplex2S.java +1138 -0
- data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SliderBar.java +1 -1
- data/src/main/java/monkstone/slider/SliderGroup.java +1 -1
- data/src/main/java/monkstone/slider/WheelHandler.java +2 -2
- data/src/main/java/monkstone/vecmath/JRender.java +6 -6
- data/src/main/java/monkstone/vecmath/package-info.java +1 -1
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +103 -83
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +27 -41
- data/src/main/java/monkstone/videoevent/CaptureEvent.java +1 -1
- data/src/main/java/monkstone/videoevent/MovieEvent.java +1 -1
- data/src/main/java/monkstone/videoevent/package-info.java +1 -1
- data/src/main/java/processing/awt/PGraphicsJava2D.java +11 -4
- data/src/main/java/processing/awt/PImageAWT.java +8 -8
- data/src/main/java/processing/core/PApplet.java +245 -254
- data/src/main/java/processing/core/PConstants.java +155 -163
- data/src/main/java/processing/core/PGraphics.java +116 -109
- data/src/main/java/processing/core/PImage.java +3025 -3047
- data/src/main/java/processing/core/PMatrix.java +5 -2
- data/src/main/java/processing/data/DoubleDict.java +72 -43
- data/src/main/java/processing/data/DoubleList.java +6 -2
- data/src/main/java/processing/data/FloatDict.java +744 -756
- data/src/main/java/processing/data/FloatList.java +68 -26
- data/src/main/java/processing/data/IntDict.java +72 -45
- data/src/main/java/processing/data/IntList.java +63 -26
- data/src/main/java/processing/data/JSONArray.java +892 -931
- data/src/main/java/processing/data/JSONObject.java +1169 -1262
- data/src/main/java/processing/data/JSONTokener.java +30 -49
- data/src/main/java/processing/data/LongDict.java +699 -712
- data/src/main/java/processing/data/LongList.java +676 -700
- data/src/main/java/processing/data/Sort.java +1 -0
- data/src/main/java/processing/data/Table.java +4040 -3661
- data/src/main/java/processing/data/TableRow.java +16 -0
- data/src/main/java/processing/data/XML.java +1041 -956
- data/src/main/java/processing/event/TouchEvent.java +1 -1
- data/src/main/java/processing/opengl/FontTexture.java +2 -2
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +28 -31
- data/src/main/java/processing/opengl/PJOGL.java +8 -7
- data/src/main/java/processing/opengl/PShader.java +1 -6
- data/src/main/java/processing/opengl/PShapeOpenGL.java +23 -24
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +6 -6
- data/src/main/java/processing/pdf/PGraphicsPDF.java +581 -0
- data/src/main/java/processing/svg/PGraphicsSVG.java +378 -0
- data/src/main/{java/processing/opengl → resources}/cursors/arrow.png +0 -0
- data/src/main/{java/processing/opengl → resources}/cursors/cross.png +0 -0
- data/src/main/{java/processing/opengl → resources}/cursors/hand.png +0 -0
- data/src/main/{java/processing/opengl → resources}/cursors/license.txt +0 -0
- data/src/main/{java/processing/opengl → resources}/cursors/move.png +0 -0
- data/src/main/{java/processing/opengl → resources}/cursors/text.png +0 -0
- data/src/main/{java/processing/opengl → resources}/cursors/wait.png +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/ColorFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/ColorVert.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/LightFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/LightVert.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/LineFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/LineVert.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/MaskFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/PointFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/PointVert.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/TexFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/TexLightFrag.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/TexLightVert.glsl +0 -0
- data/src/main/{java/processing/opengl → resources}/shaders/TexVert.glsl +0 -0
- data/test/test_helper.rb +1 -0
- data/test/vecmath_spec_test.rb +14 -3
- data/vendors/Rakefile +1 -1
- metadata +53 -53
- data/lib/propane-3.8.0.jar +0 -0
- data/src/main/java/monkstone/noise/Noise.java +0 -116
- data/src/main/java/monkstone/noise/NoiseGenerator.java +0 -63
- data/src/main/java/monkstone/noise/NoiseMode.java +0 -15
- data/src/main/java/monkstone/noise/SimplexNoise.java +0 -470
- data/src/main/java/monkstone/noise/ValueNoise.java +0 -170
metadata
CHANGED
@@ -1,84 +1,78 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: propane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- monkstone
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 0.
|
18
|
+
version: '0.10'
|
19
19
|
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.10.7
|
22
22
|
name: jruby-openssl
|
23
|
-
type: :development
|
24
23
|
prerelease: false
|
24
|
+
type: :development
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: '0.10'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.
|
32
|
+
version: 0.10.7
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
35
35
|
requirements:
|
36
36
|
- - "~>"
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version: '5.
|
38
|
+
version: '5.15'
|
39
39
|
name: minitest
|
40
|
-
type: :development
|
41
40
|
prerelease: false
|
41
|
+
type: :development
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '5.
|
46
|
+
version: '5.15'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
50
50
|
- - "~>"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
52
|
+
version: '13.0'
|
53
53
|
name: rake
|
54
|
-
type: :runtime
|
55
54
|
prerelease: false
|
55
|
+
type: :runtime
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '13.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '1.
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: 1.0.2
|
66
|
+
version: '1.2'
|
70
67
|
name: arcball
|
71
|
-
type: :runtime
|
72
68
|
prerelease: false
|
69
|
+
type: :runtime
|
73
70
|
version_requirements: !ruby/object:Gem::Requirement
|
74
71
|
requirements:
|
75
72
|
- - "~>"
|
76
73
|
- !ruby/object:Gem::Version
|
77
|
-
version: '1.
|
78
|
-
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: 1.0.2
|
81
|
-
description: " A batteries included version of processing in ruby targetting jdk11.\n"
|
74
|
+
version: '1.2'
|
75
|
+
description: " A batteries included version of processing in ruby targetting jdk11+.\n"
|
82
76
|
email:
|
83
77
|
- mamba2928@yahoo.co.uk
|
84
78
|
executables:
|
@@ -111,7 +105,7 @@ files:
|
|
111
105
|
- lib/jogl-all-natives-macosx-universal.jar
|
112
106
|
- lib/jogl-all-natives-windows-amd64.jar
|
113
107
|
- lib/jogl-all.jar
|
114
|
-
- lib/propane-
|
108
|
+
- lib/propane-4.0.0.jar
|
115
109
|
- lib/propane.rb
|
116
110
|
- lib/propane/app.rb
|
117
111
|
- lib/propane/creators/sketch_class.rb
|
@@ -135,7 +129,11 @@ files:
|
|
135
129
|
- library/library_proxy/README.md
|
136
130
|
- library/library_proxy/library_proxy.rb
|
137
131
|
- library/net/net.rb
|
132
|
+
- library/pdf/itextpdf-5.5.13.2.jar
|
133
|
+
- library/pdf/pdf.rb
|
138
134
|
- library/slider/slider.rb
|
135
|
+
- library/svg/batik-all-1.14.jar
|
136
|
+
- library/svg/svg.rb
|
139
137
|
- library/vector_utils/vector_utils.rb
|
140
138
|
- library/video_event/video_event.rb
|
141
139
|
- license.txt
|
@@ -147,18 +145,18 @@ files:
|
|
147
145
|
- src/main/java/japplemenubar/JAppleMenuBar.java
|
148
146
|
- src/main/java/japplemenubar/libjAppleMenuBar.jnilib
|
149
147
|
- src/main/java/monkstone/ColorUtil.java
|
148
|
+
- src/main/java/monkstone/FastNoiseModuleJava.java
|
150
149
|
- src/main/java/monkstone/MathToolModule.java
|
151
150
|
- src/main/java/monkstone/PropaneLibrary.java
|
151
|
+
- src/main/java/monkstone/SmoothNoiseModuleJava.java
|
152
152
|
- src/main/java/monkstone/core/LibraryProxy.java
|
153
153
|
- src/main/java/monkstone/fastmath/DegLutTables.java
|
154
154
|
- src/main/java/monkstone/fastmath/Deglut.java
|
155
155
|
- src/main/java/monkstone/fastmath/package-info.java
|
156
156
|
- src/main/java/monkstone/filechooser/Chooser.java
|
157
|
-
- src/main/java/monkstone/noise/
|
158
|
-
- src/main/java/monkstone/noise/
|
159
|
-
- src/main/java/monkstone/noise/
|
160
|
-
- src/main/java/monkstone/noise/SimplexNoise.java
|
161
|
-
- src/main/java/monkstone/noise/ValueNoise.java
|
157
|
+
- src/main/java/monkstone/noise/LICENSE
|
158
|
+
- src/main/java/monkstone/noise/OpenSimplex2F.java
|
159
|
+
- src/main/java/monkstone/noise/OpenSimplex2S.java
|
162
160
|
- src/main/java/monkstone/slider/CustomHorizontalSlider.java
|
163
161
|
- src/main/java/monkstone/slider/CustomVerticalSlider.java
|
164
162
|
- src/main/java/monkstone/slider/SimpleHorizontalSlider.java
|
@@ -240,26 +238,15 @@ files:
|
|
240
238
|
- src/main/java/processing/opengl/PSurfaceJOGL.java
|
241
239
|
- src/main/java/processing/opengl/Texture.java
|
242
240
|
- src/main/java/processing/opengl/VertexBuffer.java
|
243
|
-
- src/main/java/processing/
|
244
|
-
- src/main/java/processing/
|
245
|
-
- src/main/
|
246
|
-
- src/main/
|
247
|
-
- src/main/
|
248
|
-
- src/main/
|
249
|
-
- src/main/
|
250
|
-
- src/main/
|
251
|
-
- src/main/
|
252
|
-
- src/main/java/processing/opengl/shaders/LightFrag.glsl
|
253
|
-
- src/main/java/processing/opengl/shaders/LightVert.glsl
|
254
|
-
- src/main/java/processing/opengl/shaders/LineFrag.glsl
|
255
|
-
- src/main/java/processing/opengl/shaders/LineVert.glsl
|
256
|
-
- src/main/java/processing/opengl/shaders/MaskFrag.glsl
|
257
|
-
- src/main/java/processing/opengl/shaders/PointFrag.glsl
|
258
|
-
- src/main/java/processing/opengl/shaders/PointVert.glsl
|
259
|
-
- src/main/java/processing/opengl/shaders/TexFrag.glsl
|
260
|
-
- src/main/java/processing/opengl/shaders/TexLightFrag.glsl
|
261
|
-
- src/main/java/processing/opengl/shaders/TexLightVert.glsl
|
262
|
-
- src/main/java/processing/opengl/shaders/TexVert.glsl
|
241
|
+
- src/main/java/processing/pdf/PGraphicsPDF.java
|
242
|
+
- src/main/java/processing/svg/PGraphicsSVG.java
|
243
|
+
- src/main/resources/cursors/arrow.png
|
244
|
+
- src/main/resources/cursors/cross.png
|
245
|
+
- src/main/resources/cursors/hand.png
|
246
|
+
- src/main/resources/cursors/license.txt
|
247
|
+
- src/main/resources/cursors/move.png
|
248
|
+
- src/main/resources/cursors/text.png
|
249
|
+
- src/main/resources/cursors/wait.png
|
263
250
|
- src/main/resources/icon/icon-1024.png
|
264
251
|
- src/main/resources/icon/icon-128.png
|
265
252
|
- src/main/resources/icon/icon-16.png
|
@@ -269,6 +256,19 @@ files:
|
|
269
256
|
- src/main/resources/icon/icon-512.png
|
270
257
|
- src/main/resources/icon/icon-64.png
|
271
258
|
- src/main/resources/license.txt
|
259
|
+
- src/main/resources/shaders/ColorFrag.glsl
|
260
|
+
- src/main/resources/shaders/ColorVert.glsl
|
261
|
+
- src/main/resources/shaders/LightFrag.glsl
|
262
|
+
- src/main/resources/shaders/LightVert.glsl
|
263
|
+
- src/main/resources/shaders/LineFrag.glsl
|
264
|
+
- src/main/resources/shaders/LineVert.glsl
|
265
|
+
- src/main/resources/shaders/MaskFrag.glsl
|
266
|
+
- src/main/resources/shaders/PointFrag.glsl
|
267
|
+
- src/main/resources/shaders/PointVert.glsl
|
268
|
+
- src/main/resources/shaders/TexFrag.glsl
|
269
|
+
- src/main/resources/shaders/TexLightFrag.glsl
|
270
|
+
- src/main/resources/shaders/TexLightVert.glsl
|
271
|
+
- src/main/resources/shaders/TexVert.glsl
|
272
272
|
- test/create_test.rb
|
273
273
|
- test/deglut_spec_test.rb
|
274
274
|
- test/helper_methods_test.rb
|
@@ -300,12 +300,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
300
300
|
- !ruby/object:Gem::Version
|
301
301
|
version: '0'
|
302
302
|
requirements:
|
303
|
-
- java runtime >=
|
304
|
-
rubygems_version: 3.
|
303
|
+
- java runtime >= 17.0.1+
|
304
|
+
rubygems_version: 3.2.29
|
305
305
|
signing_key:
|
306
306
|
specification_version: 4
|
307
|
-
summary: ruby implementation of processing-4.0 on
|
308
|
-
|
307
|
+
summary: ruby implementation of processing-4.0 on linux and windows (64bit only),
|
308
|
+
might work MacOS, needs testing
|
309
309
|
test_files:
|
310
310
|
- test/create_test.rb
|
311
311
|
- test/deglut_spec_test.rb
|
data/lib/propane-3.8.0.jar
DELETED
Binary file
|
@@ -1,116 +0,0 @@
|
|
1
|
-
package monkstone.noise;
|
2
|
-
|
3
|
-
/*
|
4
|
-
* Copyright (c) 2021 Martin Prout
|
5
|
-
*
|
6
|
-
* This library is free software; you can redistribute it and/or
|
7
|
-
* modify it under the terms of the GNU General Public
|
8
|
-
* License as published by the Free Software Foundation; either
|
9
|
-
* version 3.0 of the License, or (at your option) any later version.
|
10
|
-
*
|
11
|
-
* http://creativecommons.org/licenses/LGPL/2.1/
|
12
|
-
*
|
13
|
-
* This library is distributed in the hope that it will be useful,
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
16
|
-
* Lesser General Public License for more details.
|
17
|
-
*
|
18
|
-
* You should have received a copy of the GNU General Public
|
19
|
-
* License along with this library; if not, write to the Free Software
|
20
|
-
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
21
|
-
*/
|
22
|
-
public interface Noise {
|
23
|
-
|
24
|
-
/**
|
25
|
-
*
|
26
|
-
* @param x
|
27
|
-
* @return
|
28
|
-
*/
|
29
|
-
default float noise(float x) {
|
30
|
-
return noise(x, 0);
|
31
|
-
}
|
32
|
-
|
33
|
-
/**
|
34
|
-
*
|
35
|
-
* @param x
|
36
|
-
* @param y
|
37
|
-
* @return
|
38
|
-
*/
|
39
|
-
default float noise(float x, float y) {
|
40
|
-
return noise(x, y, 0);
|
41
|
-
}
|
42
|
-
|
43
|
-
/**
|
44
|
-
* <p>
|
45
|
-
* Returns the Perlin noise value at specified coordinates. Perlin noise is
|
46
|
-
* a random sequence generator producing a more natural ordered, harmonic
|
47
|
-
* succession of numbers compared to the standard <b>random()</b> function.
|
48
|
-
* It was invented by Ken Perlin in the 1980s and been used since in
|
49
|
-
* graphical applications to produce procedural textures, natural motion,
|
50
|
-
* shapes, terrains etc. The main difference to the
|
51
|
-
* <b>random()</b> function is that Perlin noise is defined in an infinite
|
52
|
-
* n-dimensional space where each pair of coordinates corresponds to a fixed
|
53
|
-
* semi-random value (fixed only for the lifespan of the program). The
|
54
|
-
* resulting value will always be between 0.0 and 1.0. Processing can
|
55
|
-
* compute 1D, 2D and 3D noise, depending on the number of coordinates
|
56
|
-
* given. The noise value can be animated by moving through the noise space
|
57
|
-
* as demonstrated in the example above. The 2nd and 3rd dimension can also
|
58
|
-
* be interpreted as time.The actual noise is structured similar to an audio
|
59
|
-
* signal, in respect to the function's use of frequencies. Similar to the
|
60
|
-
* concept of harmonics in physics, perlin noise is computed over several
|
61
|
-
* octaves which are added together for the final result. Another way to
|
62
|
-
* adjust the character of the resulting sequence is the scale of the input
|
63
|
-
* coordinates. As the function works within an infinite space the value of
|
64
|
-
* the coordinates doesn't matter as such, only the distance between
|
65
|
-
* successive coordinates does (eg. when using <b>noise()</b> within a
|
66
|
-
* loop). As a general rule the smaller the difference between coordinates,
|
67
|
-
* the smoother the resulting noise sequence will be. Steps of 0.005-0.03
|
68
|
-
* work best for most applications, but this will differ depending on use.
|
69
|
-
* <p>
|
70
|
-
* @param x x-coordinate in noise space
|
71
|
-
* @param y y-coordinate in noise space
|
72
|
-
* @param z z-coordinate in noise space
|
73
|
-
* @return
|
74
|
-
*/
|
75
|
-
float noise(float x, float y, float z);
|
76
|
-
|
77
|
-
float noise(float x, float y, float z, float w);
|
78
|
-
|
79
|
-
void noiseMode(NoiseMode mode);
|
80
|
-
|
81
|
-
/**
|
82
|
-
* Adjusts the character and level of detail produced by the Perlin noise
|
83
|
-
* function.Similar to harmonics in physics, noise is computed over several
|
84
|
-
* octaves. Lower octaves contribute more to the output signal and as such
|
85
|
-
* define the overal intensity of the noise, whereas higher octaves create
|
86
|
-
* finer grained details in the noise sequence. By default, noise is
|
87
|
-
* computed over 4 octaves with each octave contributing exactly half than
|
88
|
-
* its predecessor, starting at 50% strength for the 1st octave. This
|
89
|
-
* falloff amount can be changed by adding an additional function parameter.
|
90
|
-
* Eg. a falloff factor of 0.75 means each octave will now have 75% impact
|
91
|
-
* (25% less) of the previous lower octave. Any value between 0.0 and 1.0 is
|
92
|
-
* valid, however note that values greater than 0.5 might result in greater
|
93
|
-
* than 1.0 values returned by <b>noise()</b>.By changing these parameters,
|
94
|
-
* the signal created by the <b>noise()</b>
|
95
|
-
* function can be adapted to fit very specific needs and characteristics.
|
96
|
-
*
|
97
|
-
* @param lod
|
98
|
-
*/
|
99
|
-
void noiseDetail(int lod);
|
100
|
-
|
101
|
-
/**
|
102
|
-
* @param lod
|
103
|
-
* @param falloff falloff factor for each octave
|
104
|
-
*/
|
105
|
-
void noiseDetail(int lod, float falloff);
|
106
|
-
|
107
|
-
/**
|
108
|
-
* Sets the seed value for <b>noise()</b>.By default, <b>noise()</b>
|
109
|
-
* produces different results each time the program is run. Set the
|
110
|
-
* <b>value</b> parameter to a constant to return the same pseudo-random
|
111
|
-
* numbers each time the software is run.
|
112
|
-
*
|
113
|
-
* @param seed
|
114
|
-
*/
|
115
|
-
void noiseSeed(long seed);
|
116
|
-
}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* To change this license header, choose License Headers in Project Properties.
|
3
|
-
* To change this template file, choose Tools | Templates
|
4
|
-
* and open the template in the editor.
|
5
|
-
*/
|
6
|
-
package monkstone.noise;
|
7
|
-
|
8
|
-
/**
|
9
|
-
*
|
10
|
-
* @author Martin Prout
|
11
|
-
*/
|
12
|
-
public class NoiseGenerator implements Noise {
|
13
|
-
|
14
|
-
private Noise implementation;
|
15
|
-
private NoiseMode mode;
|
16
|
-
|
17
|
-
public NoiseGenerator() {
|
18
|
-
this.implementation = new ValueNoise();
|
19
|
-
this.mode = NoiseMode.PERLIN;
|
20
|
-
}
|
21
|
-
|
22
|
-
public void noiseMode(NoiseMode mode) {
|
23
|
-
if (this.mode != mode && this.mode != NoiseMode.PERLIN) {
|
24
|
-
this.implementation = new ValueNoise();
|
25
|
-
this.mode = NoiseMode.PERLIN;
|
26
|
-
}
|
27
|
-
if (this.mode != mode && this.mode != NoiseMode.SIMPLEX) {
|
28
|
-
this.implementation = new SimplexNoise();
|
29
|
-
this.mode = NoiseMode.SIMPLEX;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
|
33
|
-
public NoiseMode noiseMode(){
|
34
|
-
return this.mode;
|
35
|
-
}
|
36
|
-
|
37
|
-
@Override
|
38
|
-
public float noise(float x, float y, float z) {
|
39
|
-
return implementation.noise(x, y, z);
|
40
|
-
}
|
41
|
-
|
42
|
-
@Override
|
43
|
-
public float noise(float x, float y, float z, float w) {
|
44
|
-
if (mode == NoiseMode.PERLIN) { return 0.5f;}
|
45
|
-
return implementation.noise(x, y, z, w);
|
46
|
-
}
|
47
|
-
|
48
|
-
@Override
|
49
|
-
public void noiseDetail(int lod) {
|
50
|
-
implementation.noiseDetail(lod);
|
51
|
-
}
|
52
|
-
|
53
|
-
@Override
|
54
|
-
public void noiseDetail(int lod, float falloff) {
|
55
|
-
implementation.noiseDetail(lod, falloff);
|
56
|
-
}
|
57
|
-
|
58
|
-
@Override
|
59
|
-
public void noiseSeed(long seed) {
|
60
|
-
implementation.noiseSeed(seed);
|
61
|
-
}
|
62
|
-
|
63
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* To change this license header, choose License Headers in Project Properties.
|
3
|
-
* To change this template file, choose Tools | Templates
|
4
|
-
* and open the template in the editor.
|
5
|
-
*/
|
6
|
-
package monkstone.noise;
|
7
|
-
|
8
|
-
/**
|
9
|
-
*
|
10
|
-
* @author tux
|
11
|
-
*/
|
12
|
-
public enum NoiseMode {
|
13
|
-
SIMPLEX,
|
14
|
-
PERLIN;
|
15
|
-
}
|