picrate 2.4.0-java → 2.5.1-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.mvn/wrapper/maven-wrapper.properties +1 -1
- data/CHANGELOG.md +9 -1
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/docs/.gitignore +1 -0
- data/docs/_classes/{app_render → gfx_render}/app_render.md +5 -5
- data/docs/_methods/{noise_mode.md → noise_modes.md} +9 -21
- data/docs/_posts/2018-05-06-install_jruby.md +5 -5
- data/docs/_posts/2019-11-11-getting_started_buster.md +2 -2
- data/docs/_posts/2020-05-11-getting_started_manjaro.md +13 -4
- data/docs/about.md +1 -1
- data/lib/picrate/app.rb +2 -8
- data/lib/picrate/helper_methods.rb +6 -6
- data/lib/picrate/native_folder.rb +1 -1
- data/lib/picrate/version.rb +1 -1
- data/lib/{picrate-2.4.0.jar → picrate-2.5.1.jar} +0 -0
- data/picrate.gemspec +1 -1
- data/pom.rb +4 -4
- data/pom.xml +6 -9
- data/src/main/java/monkstone/FastNoiseModuleJava.java +19 -19
- data/src/main/java/monkstone/SmoothNoiseModuleJava.java +19 -19
- data/src/main/java/monkstone/noise/OpenSimplex2F.java +838 -737
- data/src/main/java/monkstone/noise/OpenSimplex2S.java +1 -1
- data/src/main/java/monkstone/vecmath/GfxRender.java +10 -11
- data/src/main/java/monkstone/vecmath/JRender.java +7 -7
- data/src/main/java/monkstone/vecmath/ShapeRender.java +3 -4
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +28 -40
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +30 -45
- data/src/main/java/processing/awt/PImageAWT.java +1 -1
- data/src/main/java/processing/awt/ShimAWT.java +1 -1
- data/src/main/java/processing/core/PApplet.java +1 -1
- data/src/main/java/processing/core/PImage.java +14 -14
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -13
- data/src/main/java/processing/opengl/PShader.java +0 -6
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +4 -4
- 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/noise_test.rb +17 -0
- data/test/test_helper.rb +1 -1
- data/vendors/Rakefile +1 -1
- metadata +30 -41
- data/src/main/java/japplemenubar/JAppleMenuBar.java +0 -96
- data/src/main/java/japplemenubar/libjAppleMenuBar.jnilib +0 -0
- data/src/main/java/monkstone/complex/JComplex.java +0 -252
- data/src/main/java/monkstone/vecmath/AppRender.java +0 -88
- data/src/main/java/monkstone/vecmath/package-info.java +0 -20
- data/src/main/java/monkstone/vecmath/vec2/package-info.java +0 -6
- data/src/main/java/monkstone/vecmath/vec3/package-info.java +0 -6
@@ -1,252 +0,0 @@
|
|
1
|
-
package monkstone.complex;
|
2
|
-
|
3
|
-
import java.util.Objects;
|
4
|
-
|
5
|
-
/**
|
6
|
-
* The purpose of this class is to to make Complex operations more efficient
|
7
|
-
* than JRuby RubyComplex, by having a simpler interface, only modest
|
8
|
-
* improvements were obtained (but this is better than nothing on RaspberryPI).
|
9
|
-
*/
|
10
|
-
public final class JComplex {
|
11
|
-
|
12
|
-
private final double re; // the real part
|
13
|
-
private final double im; // the imaginary part
|
14
|
-
private final static JComplex ZERO = new JComplex(0, 0);
|
15
|
-
private final static JComplex NAN = new JComplex(Double.NaN, Double.NaN);
|
16
|
-
|
17
|
-
/**
|
18
|
-
* create a new object with the given real and imaginary parts
|
19
|
-
*
|
20
|
-
* @param real
|
21
|
-
* @param imag
|
22
|
-
*/
|
23
|
-
public JComplex(double real, double imag) {
|
24
|
-
re = real;
|
25
|
-
im = imag;
|
26
|
-
}
|
27
|
-
|
28
|
-
/**
|
29
|
-
* @return a string representation of the invoking Complex object
|
30
|
-
*/
|
31
|
-
@Override
|
32
|
-
public String toString() {
|
33
|
-
return "JComplex(" + re + ", " + im + "i)";
|
34
|
-
}
|
35
|
-
|
36
|
-
/**
|
37
|
-
*
|
38
|
-
* @return abs/modulus/magnitude
|
39
|
-
*/
|
40
|
-
public final double abs() {
|
41
|
-
return Math.hypot(re, im);
|
42
|
-
}
|
43
|
-
|
44
|
-
/**
|
45
|
-
*
|
46
|
-
* @return square of abs/modulus/magnitude
|
47
|
-
*/
|
48
|
-
public final double abs2() {
|
49
|
-
return re * re + im * im;
|
50
|
-
}
|
51
|
-
|
52
|
-
/**
|
53
|
-
*
|
54
|
-
* @return angle/phase/argument, normalized to be between -pi and pi
|
55
|
-
*/
|
56
|
-
public final double phase() {
|
57
|
-
return Math.atan2(im, re);
|
58
|
-
}
|
59
|
-
|
60
|
-
/**
|
61
|
-
*
|
62
|
-
* @param b
|
63
|
-
* @return a new Complex object whose value is (this + b)
|
64
|
-
*/
|
65
|
-
public final JComplex add(JComplex b) {
|
66
|
-
JComplex a = this; // invoking object
|
67
|
-
double real = a.re + b.re;
|
68
|
-
double imag = a.im + b.im;
|
69
|
-
return new JComplex(real, imag);
|
70
|
-
}
|
71
|
-
|
72
|
-
/**
|
73
|
-
*
|
74
|
-
* @param scalar
|
75
|
-
* @return a new Complex object whose value is (this + scalar)
|
76
|
-
*/
|
77
|
-
public final JComplex add(double scalar) {
|
78
|
-
return new JComplex(re + scalar, im);
|
79
|
-
}
|
80
|
-
|
81
|
-
public final boolean zero() {
|
82
|
-
return this.equals(ZERO);
|
83
|
-
}
|
84
|
-
|
85
|
-
/**
|
86
|
-
*
|
87
|
-
* @param b
|
88
|
-
* @return a new Complex object whose value is (this - b)
|
89
|
-
*/
|
90
|
-
public final JComplex sub(JComplex b) {
|
91
|
-
JComplex a = this;
|
92
|
-
double real = a.re - b.re;
|
93
|
-
double imag = a.im - b.im;
|
94
|
-
return new JComplex(real, imag);
|
95
|
-
}
|
96
|
-
|
97
|
-
/**
|
98
|
-
*
|
99
|
-
* @param scalar
|
100
|
-
* @return a new Complex object whose value is (this - scalar)
|
101
|
-
*/
|
102
|
-
public final JComplex sub(double scalar) {
|
103
|
-
return new JComplex(re - scalar, im);
|
104
|
-
}
|
105
|
-
|
106
|
-
/**
|
107
|
-
*
|
108
|
-
* @param b
|
109
|
-
* @return a new Complex object whose value is (this * b)
|
110
|
-
*/
|
111
|
-
public final JComplex mul(JComplex b) {
|
112
|
-
JComplex a = this;
|
113
|
-
double real = a.re * b.re - a.im * b.im;
|
114
|
-
double imag = a.re * b.im + a.im * b.re;
|
115
|
-
return new JComplex(real, imag);
|
116
|
-
}
|
117
|
-
|
118
|
-
/**
|
119
|
-
* Also known as scale
|
120
|
-
*
|
121
|
-
* @param b
|
122
|
-
* @return a new Complex object whose value is (this * b)
|
123
|
-
*/
|
124
|
-
public final JComplex mul(double b) {
|
125
|
-
return new JComplex(re * b, im * b);
|
126
|
-
}
|
127
|
-
|
128
|
-
/**
|
129
|
-
*
|
130
|
-
* @return a new Complex object whose value is the conjugate of this
|
131
|
-
*/
|
132
|
-
public final JComplex conjugate() {
|
133
|
-
return new JComplex(re, -im);
|
134
|
-
}
|
135
|
-
|
136
|
-
/**
|
137
|
-
*
|
138
|
-
* @return a new Complex object whose value is the reciprocal of this
|
139
|
-
*/
|
140
|
-
private JComplex reciprocal() {
|
141
|
-
double scale = re * re + im * im; // self dot product
|
142
|
-
return new JComplex(re / scale, -im / scale);
|
143
|
-
}
|
144
|
-
|
145
|
-
/**
|
146
|
-
*
|
147
|
-
* @param other
|
148
|
-
* @return this^other
|
149
|
-
*/
|
150
|
-
public final JComplex pow(JComplex other) {
|
151
|
-
if (this.zero()) {
|
152
|
-
if (other.zero()) {
|
153
|
-
return ZERO;
|
154
|
-
}
|
155
|
-
return NAN;
|
156
|
-
}
|
157
|
-
return (this).log().mul(other).exp();
|
158
|
-
}
|
159
|
-
|
160
|
-
/**
|
161
|
-
*
|
162
|
-
* @param scalar
|
163
|
-
* @return this^scalar
|
164
|
-
*/
|
165
|
-
public final JComplex pow(double scalar) {
|
166
|
-
if (this.zero()) {
|
167
|
-
if (scalar == 0) {
|
168
|
-
return ZERO;
|
169
|
-
}
|
170
|
-
return NAN;
|
171
|
-
}
|
172
|
-
return (this).log().mul(scalar).exp();
|
173
|
-
}
|
174
|
-
|
175
|
-
/**
|
176
|
-
*
|
177
|
-
* @return log
|
178
|
-
*/
|
179
|
-
private JComplex log() {
|
180
|
-
return new JComplex(Math.log(abs()), Math.atan2(im, re));
|
181
|
-
}
|
182
|
-
|
183
|
-
/**
|
184
|
-
*
|
185
|
-
* @return real part
|
186
|
-
*/
|
187
|
-
public final double re() {
|
188
|
-
return re;
|
189
|
-
}
|
190
|
-
|
191
|
-
/**
|
192
|
-
*
|
193
|
-
* @return imaginary part
|
194
|
-
*/
|
195
|
-
public final double im() {
|
196
|
-
return im;
|
197
|
-
}
|
198
|
-
|
199
|
-
/**
|
200
|
-
*
|
201
|
-
* @param b
|
202
|
-
* @return a / b
|
203
|
-
*/
|
204
|
-
public final JComplex div(JComplex b) {
|
205
|
-
JComplex a = this;
|
206
|
-
return a.mul(b.reciprocal());
|
207
|
-
}
|
208
|
-
|
209
|
-
/**
|
210
|
-
*
|
211
|
-
* @param b
|
212
|
-
* @return a / b
|
213
|
-
*/
|
214
|
-
public final JComplex div(double b) {
|
215
|
-
if (b == 0) {
|
216
|
-
return NAN;
|
217
|
-
}
|
218
|
-
return new JComplex(re / b, im / b);
|
219
|
-
}
|
220
|
-
|
221
|
-
/**
|
222
|
-
*
|
223
|
-
* @return a new Complex object whose value is the complex exponential of
|
224
|
-
* this
|
225
|
-
*/
|
226
|
-
public final JComplex exp() {
|
227
|
-
return new JComplex(Math.exp(re) * Math.cos(im), Math.exp(re) * Math.sin(im));
|
228
|
-
}
|
229
|
-
|
230
|
-
@Override
|
231
|
-
public final int hashCode() {
|
232
|
-
return Objects.hash(re, im);
|
233
|
-
}
|
234
|
-
|
235
|
-
@Override
|
236
|
-
public final boolean equals(Object obj) {
|
237
|
-
if (this == obj) {
|
238
|
-
return true;
|
239
|
-
}
|
240
|
-
if (obj == null) {
|
241
|
-
return false;
|
242
|
-
}
|
243
|
-
if (getClass() != obj.getClass()) {
|
244
|
-
return false;
|
245
|
-
}
|
246
|
-
final JComplex other = (JComplex) obj;
|
247
|
-
if (Double.doubleToLongBits(this.re) != Double.doubleToLongBits(other.re)) {
|
248
|
-
return false;
|
249
|
-
}
|
250
|
-
return Double.doubleToLongBits(this.im) == Double.doubleToLongBits(other.im);
|
251
|
-
}
|
252
|
-
}
|
@@ -1,88 +0,0 @@
|
|
1
|
-
package monkstone.vecmath;
|
2
|
-
|
3
|
-
import processing.core.PApplet;
|
4
|
-
import processing.core.PGraphics;
|
5
|
-
|
6
|
-
/**
|
7
|
-
*
|
8
|
-
*
|
9
|
-
* @author Martin Prout
|
10
|
-
*/
|
11
|
-
public class AppRender implements JRender {
|
12
|
-
|
13
|
-
final PGraphics g;
|
14
|
-
|
15
|
-
/**
|
16
|
-
*
|
17
|
-
* @param app PApplet
|
18
|
-
*/
|
19
|
-
public AppRender(final PApplet app) {
|
20
|
-
this.g = app.g;
|
21
|
-
}
|
22
|
-
|
23
|
-
/**
|
24
|
-
*
|
25
|
-
* @param x double
|
26
|
-
* @param y double
|
27
|
-
*/
|
28
|
-
@Override
|
29
|
-
public void vertex(double x, double y) {
|
30
|
-
g.vertex((float) x, (float) y);
|
31
|
-
}
|
32
|
-
|
33
|
-
/**
|
34
|
-
*
|
35
|
-
* @param x double
|
36
|
-
* @param y double
|
37
|
-
*/
|
38
|
-
@Override
|
39
|
-
public void curveVertex(double x, double y) {
|
40
|
-
g.curveVertex((float) x, (float) y);
|
41
|
-
}
|
42
|
-
|
43
|
-
/**
|
44
|
-
*
|
45
|
-
* @param x double
|
46
|
-
* @param y double
|
47
|
-
* @param z double
|
48
|
-
*/
|
49
|
-
@Override
|
50
|
-
public void vertex(double x, double y, double z) {
|
51
|
-
g.vertex((float) x, (float) y, (float) z);
|
52
|
-
}
|
53
|
-
|
54
|
-
/**
|
55
|
-
*
|
56
|
-
* @param x double
|
57
|
-
* @param y double
|
58
|
-
* @param z double
|
59
|
-
*/
|
60
|
-
@Override
|
61
|
-
public void normal(double x, double y, double z) {
|
62
|
-
g.normal((float) x, (float) y, (float) z);
|
63
|
-
}
|
64
|
-
|
65
|
-
/**
|
66
|
-
*
|
67
|
-
* @param x double
|
68
|
-
* @param y double
|
69
|
-
* @param z double
|
70
|
-
* @param u double
|
71
|
-
* @param v double
|
72
|
-
*/
|
73
|
-
@Override
|
74
|
-
public void vertex(double x, double y, double z, double u, double v) {
|
75
|
-
g.vertex((float) x, (float) y, (float) z, (float) u, (float) v);
|
76
|
-
}
|
77
|
-
|
78
|
-
/**
|
79
|
-
*
|
80
|
-
* @param x double
|
81
|
-
* @param y double
|
82
|
-
* @param z double
|
83
|
-
*/
|
84
|
-
@Override
|
85
|
-
public void curveVertex(double x, double y, double z) {
|
86
|
-
g.curveVertex((float) x, (float) y, (float) z);
|
87
|
-
}
|
88
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright (c) 2018-21 Martin Prout
|
3
|
-
*
|
4
|
-
* This library is free software; you can redistribute it and/or
|
5
|
-
* modify it under the terms of the GNU General Public
|
6
|
-
* License as published by the Free Software Foundation; either
|
7
|
-
* version 3.0 of the License, or (at your option) any later version.
|
8
|
-
*
|
9
|
-
* http://creativecommons.org/licenses/LGPL/2.1/
|
10
|
-
*
|
11
|
-
* This library is distributed in the hope that it will be useful,
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
-
* Lesser General Public License for more details.
|
15
|
-
*
|
16
|
-
* You should have received a copy of the GNU General Public
|
17
|
-
* License along with this library; if not, write to the Free Software
|
18
|
-
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
19
|
-
*/
|
20
|
-
package monkstone.vecmath;
|