propane 3.9.0-java → 3.10.0-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/.travis.yml +1 -1
- data/CHANGELOG.md +2 -2
- data/README.md +3 -3
- data/Rakefile +6 -6
- data/lib/java/japplemenubar/JAppleMenuBar.java +88 -0
- data/lib/java/japplemenubar/libjAppleMenuBar.jnilib +0 -0
- data/lib/java/monkstone/ColorUtil.java +127 -0
- data/lib/java/monkstone/MathToolModule.java +287 -0
- data/lib/java/monkstone/PropaneLibrary.java +46 -0
- data/lib/java/monkstone/core/LibraryProxy.java +136 -0
- data/lib/java/monkstone/fastmath/DegLutTables.java +111 -0
- data/lib/java/monkstone/fastmath/Deglut.java +71 -0
- data/lib/java/monkstone/fastmath/package-info.java +6 -0
- data/lib/java/monkstone/filechooser/Chooser.java +39 -0
- data/{src/main → lib}/java/monkstone/noise/FastTerrain.java +0 -0
- data/{src/main → lib}/java/monkstone/noise/Noise.java +0 -0
- data/{src/main → lib}/java/monkstone/noise/NoiseGenerator.java +0 -0
- data/{src/main → lib}/java/monkstone/noise/NoiseMode.java +0 -0
- data/lib/java/monkstone/noise/OpenSimplex2F.java +881 -0
- data/lib/java/monkstone/noise/OpenSimplex2S.java +1106 -0
- data/{src/main → lib}/java/monkstone/noise/SmoothTerrain.java +0 -0
- data/lib/java/monkstone/slider/CustomHorizontalSlider.java +164 -0
- data/lib/java/monkstone/slider/CustomVerticalSlider.java +178 -0
- data/lib/java/monkstone/slider/SimpleHorizontalSlider.java +145 -0
- data/lib/java/monkstone/slider/SimpleSlider.java +166 -0
- data/lib/java/monkstone/slider/SimpleVerticalSlider.java +157 -0
- data/lib/java/monkstone/slider/Slider.java +61 -0
- data/lib/java/monkstone/slider/SliderBar.java +245 -0
- data/lib/java/monkstone/slider/SliderGroup.java +56 -0
- data/lib/java/monkstone/slider/WheelHandler.java +35 -0
- data/lib/java/monkstone/vecmath/GfxRender.java +86 -0
- data/lib/java/monkstone/vecmath/JRender.java +56 -0
- data/lib/java/monkstone/vecmath/ShapeRender.java +87 -0
- data/lib/java/monkstone/vecmath/package-info.java +20 -0
- data/lib/java/monkstone/vecmath/vec2/Vec2.java +802 -0
- data/lib/java/monkstone/vecmath/vec2/package-info.java +6 -0
- data/lib/java/monkstone/vecmath/vec3/Vec3.java +727 -0
- data/lib/java/monkstone/vecmath/vec3/package-info.java +6 -0
- data/lib/java/monkstone/videoevent/CaptureEvent.java +27 -0
- data/lib/java/monkstone/videoevent/MovieEvent.java +32 -0
- data/lib/java/monkstone/videoevent/package-info.java +20 -0
- data/lib/java/processing/awt/PGraphicsJava2D.java +3040 -0
- data/lib/java/processing/awt/PImageAWT.java +377 -0
- data/lib/java/processing/awt/PShapeJava2D.java +387 -0
- data/lib/java/processing/awt/PSurfaceAWT.java +1581 -0
- data/lib/java/processing/awt/ShimAWT.java +581 -0
- data/lib/java/processing/core/PApplet.java +15156 -0
- data/lib/java/processing/core/PConstants.java +523 -0
- data/lib/java/processing/core/PFont.java +1126 -0
- data/lib/java/processing/core/PGraphics.java +8600 -0
- data/lib/java/processing/core/PImage.java +3377 -0
- data/lib/java/processing/core/PMatrix.java +208 -0
- data/lib/java/processing/core/PMatrix2D.java +562 -0
- data/lib/java/processing/core/PMatrix3D.java +890 -0
- data/lib/java/processing/core/PShape.java +3561 -0
- data/lib/java/processing/core/PShapeOBJ.java +483 -0
- data/lib/java/processing/core/PShapeSVG.java +2016 -0
- data/lib/java/processing/core/PStyle.java +63 -0
- data/lib/java/processing/core/PSurface.java +198 -0
- data/lib/java/processing/core/PSurfaceNone.java +431 -0
- data/lib/java/processing/core/PVector.java +1066 -0
- data/lib/java/processing/core/ThinkDifferent.java +115 -0
- data/lib/java/processing/data/DoubleDict.java +850 -0
- data/lib/java/processing/data/DoubleList.java +928 -0
- data/lib/java/processing/data/FloatDict.java +847 -0
- data/lib/java/processing/data/FloatList.java +936 -0
- data/lib/java/processing/data/IntDict.java +807 -0
- data/lib/java/processing/data/IntList.java +936 -0
- data/lib/java/processing/data/JSONArray.java +1260 -0
- data/lib/java/processing/data/JSONObject.java +2282 -0
- data/lib/java/processing/data/JSONTokener.java +435 -0
- data/lib/java/processing/data/LongDict.java +802 -0
- data/lib/java/processing/data/LongList.java +937 -0
- data/lib/java/processing/data/Sort.java +46 -0
- data/lib/java/processing/data/StringDict.java +613 -0
- data/lib/java/processing/data/StringList.java +800 -0
- data/lib/java/processing/data/Table.java +4936 -0
- data/lib/java/processing/data/TableRow.java +198 -0
- data/lib/java/processing/data/XML.java +1156 -0
- data/lib/java/processing/dxf/RawDXF.java +404 -0
- data/lib/java/processing/event/Event.java +125 -0
- data/lib/java/processing/event/KeyEvent.java +70 -0
- data/lib/java/processing/event/MouseEvent.java +114 -0
- data/lib/java/processing/event/TouchEvent.java +57 -0
- data/lib/java/processing/javafx/PGraphicsFX2D.java +32 -0
- data/lib/java/processing/javafx/PSurfaceFX.java +173 -0
- data/lib/java/processing/net/Client.java +744 -0
- data/lib/java/processing/net/Server.java +388 -0
- data/lib/java/processing/opengl/FontTexture.java +378 -0
- data/lib/java/processing/opengl/FrameBuffer.java +513 -0
- data/lib/java/processing/opengl/LinePath.java +627 -0
- data/lib/java/processing/opengl/LineStroker.java +681 -0
- data/lib/java/processing/opengl/PGL.java +3483 -0
- data/lib/java/processing/opengl/PGraphics2D.java +615 -0
- data/lib/java/processing/opengl/PGraphics3D.java +281 -0
- data/lib/java/processing/opengl/PGraphicsOpenGL.java +13753 -0
- data/lib/java/processing/opengl/PJOGL.java +2008 -0
- data/lib/java/processing/opengl/PShader.java +1484 -0
- data/lib/java/processing/opengl/PShapeOpenGL.java +5269 -0
- data/lib/java/processing/opengl/PSurfaceJOGL.java +1385 -0
- data/lib/java/processing/opengl/Texture.java +1696 -0
- data/lib/java/processing/opengl/VertexBuffer.java +88 -0
- data/lib/java/processing/opengl/cursors/arrow.png +0 -0
- data/lib/java/processing/opengl/cursors/cross.png +0 -0
- data/lib/java/processing/opengl/cursors/hand.png +0 -0
- data/lib/java/processing/opengl/cursors/license.txt +27 -0
- data/lib/java/processing/opengl/cursors/move.png +0 -0
- data/lib/java/processing/opengl/cursors/text.png +0 -0
- data/lib/java/processing/opengl/cursors/wait.png +0 -0
- data/lib/java/processing/opengl/shaders/ColorFrag.glsl +32 -0
- data/lib/java/processing/opengl/shaders/ColorVert.glsl +34 -0
- data/lib/java/processing/opengl/shaders/LightFrag.glsl +33 -0
- data/lib/java/processing/opengl/shaders/LightVert.glsl +151 -0
- data/lib/java/processing/opengl/shaders/LineFrag.glsl +32 -0
- data/lib/java/processing/opengl/shaders/LineVert.glsl +100 -0
- data/lib/java/processing/opengl/shaders/MaskFrag.glsl +40 -0
- data/lib/java/processing/opengl/shaders/PointFrag.glsl +32 -0
- data/lib/java/processing/opengl/shaders/PointVert.glsl +56 -0
- data/lib/java/processing/opengl/shaders/TexFrag.glsl +37 -0
- data/lib/java/processing/opengl/shaders/TexLightFrag.glsl +37 -0
- data/lib/java/processing/opengl/shaders/TexLightVert.glsl +157 -0
- data/lib/java/processing/opengl/shaders/TexVert.glsl +38 -0
- data/lib/java/processing/pdf/PGraphicsPDF.java +581 -0
- data/lib/java/processing/svg/PGraphicsSVG.java +378 -0
- data/lib/propane/app.rb +8 -13
- data/lib/propane/version.rb +1 -1
- data/mvnw +3 -3
- data/mvnw.cmd +2 -2
- data/pom.rb +7 -2
- data/pom.xml +14 -2
- data/propane.gemspec +2 -2
- data/src/main/java/monkstone/FastNoiseModuleJava.java +127 -0
- data/src/main/java/monkstone/MathToolModule.java +30 -30
- data/src/main/java/monkstone/PropaneLibrary.java +2 -0
- data/src/main/java/monkstone/SmoothNoiseModuleJava.java +127 -0
- data/src/main/java/monkstone/fastmath/DegLutTables.java +15 -15
- data/src/main/java/monkstone/filechooser/Chooser.java +1 -1
- data/src/main/java/monkstone/noise/OpenSimplex2F.java +752 -820
- data/src/main/java/monkstone/noise/OpenSimplex2S.java +1138 -1106
- data/src/main/java/monkstone/slider/WheelHandler.java +1 -1
- data/src/main/java/monkstone/vecmath/JRender.java +6 -6
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +20 -19
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +12 -12
- data/src/main/java/processing/awt/PGraphicsJava2D.java +11 -3
- data/src/main/java/processing/core/PApplet.java +89 -89
- data/src/main/java/processing/core/PConstants.java +155 -163
- data/src/main/java/processing/opengl/PJOGL.java +6 -5
- data/vendors/Rakefile +1 -1
- metadata +136 -19
|
@@ -11,14 +11,14 @@ public interface JRender {
|
|
|
11
11
|
* @param x double
|
|
12
12
|
* @param y double
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
void vertex(double x, double y);
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
* @param x double
|
|
19
19
|
* @param y double
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
void curveVertex(double x, double y);
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
*
|
|
@@ -26,7 +26,7 @@ public interface JRender {
|
|
|
26
26
|
* @param y double
|
|
27
27
|
* @param z double
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
void vertex(double x, double y, double z);
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
*
|
|
@@ -36,7 +36,7 @@ public interface JRender {
|
|
|
36
36
|
* @param u double
|
|
37
37
|
* @param v double
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
void vertex(double x, double y, double z, double u, double v);
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
*
|
|
@@ -44,7 +44,7 @@ public interface JRender {
|
|
|
44
44
|
* @param y double
|
|
45
45
|
* @param z double
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
void curveVertex(double x, double y, double z);
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
*
|
|
@@ -52,5 +52,5 @@ public interface JRender {
|
|
|
52
52
|
* @param y double
|
|
53
53
|
* @param z double
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
void normal(double x, double y, double z);
|
|
56
56
|
}
|
|
@@ -40,7 +40,7 @@ import monkstone.vecmath.JRender;
|
|
|
40
40
|
* @author Martin Prout
|
|
41
41
|
*/
|
|
42
42
|
@JRubyClass(name = "Vec2D")
|
|
43
|
-
public class Vec2 extends RubyObject {
|
|
43
|
+
public final class Vec2 extends RubyObject {
|
|
44
44
|
|
|
45
45
|
static final double EPSILON = 9.999999747378752e-05; // matches processing.org EPSILON
|
|
46
46
|
private static final long serialVersionUID = -2950154560223211646L;
|
|
@@ -73,7 +73,7 @@ public class Vec2 extends RubyObject {
|
|
|
73
73
|
* @return new Vec2 object (ruby)
|
|
74
74
|
*/
|
|
75
75
|
@JRubyMethod(name = "new", meta = true, rest = true)
|
|
76
|
-
public static
|
|
76
|
+
public static IRubyObject rbNew(ThreadContext context, IRubyObject klazz, IRubyObject... args) {
|
|
77
77
|
Vec2 vec2 = (Vec2) ((RubyClass) klazz).allocate();
|
|
78
78
|
vec2.init(context, args);
|
|
79
79
|
return vec2;
|
|
@@ -91,16 +91,16 @@ public class Vec2 extends RubyObject {
|
|
|
91
91
|
void init(ThreadContext context, IRubyObject... args) {
|
|
92
92
|
int count = args.length;
|
|
93
93
|
if (count == 2) {
|
|
94
|
-
jx =
|
|
95
|
-
jy =
|
|
94
|
+
jx = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
|
|
95
|
+
jy = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
|
|
96
96
|
} // allow ruby ducktyping in constructor
|
|
97
97
|
if (count == 1) {
|
|
98
98
|
if (!(args[0].respondsTo("x"))) {
|
|
99
99
|
throw context.runtime.newTypeError(args[0].getType() + " doesn't respond_to :x & :y");
|
|
100
100
|
}
|
|
101
|
-
jx =
|
|
101
|
+
jx = args[0].callMethod(context, "x") instanceof RubyFloat
|
|
102
102
|
? ((RubyFloat) args[0].callMethod(context, "x")).getValue() : ((RubyFixnum) args[0].callMethod(context, "x")).getDoubleValue();
|
|
103
|
-
jy =
|
|
103
|
+
jy = args[0].callMethod(context, "y") instanceof RubyFloat
|
|
104
104
|
? ((RubyFloat) args[0].callMethod(context, "y")).getValue() : ((RubyFixnum) args[0].callMethod(context, "y")).getDoubleValue();
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -162,10 +162,10 @@ public class Vec2 extends RubyObject {
|
|
|
162
162
|
Ruby runtime = context.runtime;
|
|
163
163
|
if (key instanceof RubySymbol) {
|
|
164
164
|
if (key == RubySymbol.newSymbol(runtime, "x")) {
|
|
165
|
-
jx =
|
|
165
|
+
jx = value instanceof RubyFloat
|
|
166
166
|
? ((RubyFloat) value).getValue() : ((RubyFixnum) value).getDoubleValue();
|
|
167
167
|
} else if (key == RubySymbol.newSymbol(runtime, "y")) {
|
|
168
|
-
jy =
|
|
168
|
+
jy = value instanceof RubyFloat
|
|
169
169
|
? ((RubyFloat) value).getValue() : ((RubyFixnum) value).getDoubleValue();
|
|
170
170
|
}
|
|
171
171
|
} else {
|
|
@@ -224,7 +224,7 @@ public class Vec2 extends RubyObject {
|
|
|
224
224
|
} else {
|
|
225
225
|
throw runtime.newTypeError("argument should be Vec2D");
|
|
226
226
|
}
|
|
227
|
-
double result = Math.hypot(
|
|
227
|
+
double result = Math.hypot(jx - b.jx, jy - b.jy);
|
|
228
228
|
return runtime.newFloat(result);
|
|
229
229
|
}
|
|
230
230
|
|
|
@@ -318,7 +318,7 @@ public class Vec2 extends RubyObject {
|
|
|
318
318
|
|
|
319
319
|
public IRubyObject op_mul(ThreadContext context, IRubyObject other) {
|
|
320
320
|
Ruby runtime = context.runtime;
|
|
321
|
-
double scalar =
|
|
321
|
+
double scalar = other instanceof RubyFloat
|
|
322
322
|
? ((RubyFloat) other).getValue() : ((RubyFixnum) other).getDoubleValue();
|
|
323
323
|
return Vec2.rbNew(context, this.getMetaClass(),
|
|
324
324
|
new IRubyObject[]{runtime.newFloat(jx * scalar),
|
|
@@ -335,7 +335,7 @@ public class Vec2 extends RubyObject {
|
|
|
335
335
|
|
|
336
336
|
public IRubyObject op_div(ThreadContext context, IRubyObject other) {
|
|
337
337
|
Ruby runtime = context.runtime;
|
|
338
|
-
double scalar =
|
|
338
|
+
double scalar = other instanceof RubyFloat
|
|
339
339
|
? ((RubyFloat) other).getValue() : ((RubyFixnum) other).getDoubleValue();
|
|
340
340
|
if (Math.abs(scalar) < Vec2.EPSILON) {
|
|
341
341
|
return this;
|
|
@@ -489,7 +489,7 @@ public class Vec2 extends RubyObject {
|
|
|
489
489
|
@JRubyMethod(name = "from_angle", meta = true)
|
|
490
490
|
public static IRubyObject from_angle(ThreadContext context, IRubyObject klazz, IRubyObject scalar) {
|
|
491
491
|
Ruby runtime = context.runtime;
|
|
492
|
-
double angle =
|
|
492
|
+
double angle = scalar instanceof RubyFloat
|
|
493
493
|
? ((RubyFloat) scalar).getValue() : ((RubyFixnum) scalar).getDoubleValue();
|
|
494
494
|
return Vec2.rbNew(context, klazz, new IRubyObject[]{
|
|
495
495
|
runtime.newFloat(Math.cos(angle)),
|
|
@@ -520,10 +520,10 @@ public class Vec2 extends RubyObject {
|
|
|
520
520
|
*/
|
|
521
521
|
@JRubyMethod(name = "rotate!")
|
|
522
522
|
public IRubyObject rotate_bang(ThreadContext context, IRubyObject scalar) {
|
|
523
|
-
double theta =
|
|
523
|
+
double theta = scalar instanceof RubyFloat
|
|
524
524
|
? ((RubyFloat) scalar).getValue() : ((RubyFixnum) scalar).getDoubleValue();
|
|
525
|
-
double x =
|
|
526
|
-
double y =
|
|
525
|
+
double x = jx * Math.cos(theta) - jy * Math.sin(theta);
|
|
526
|
+
double y = jx * Math.sin(theta) + jy * Math.cos(theta);
|
|
527
527
|
jx = x;
|
|
528
528
|
jy = y;
|
|
529
529
|
return this;
|
|
@@ -538,7 +538,7 @@ public class Vec2 extends RubyObject {
|
|
|
538
538
|
@JRubyMethod(name = "rotate")
|
|
539
539
|
public IRubyObject rotate(ThreadContext context, IRubyObject scalar) {
|
|
540
540
|
Ruby runtime = context.runtime;
|
|
541
|
-
double theta =
|
|
541
|
+
double theta = scalar instanceof RubyFloat
|
|
542
542
|
? ((RubyFloat) scalar).getValue() : ((RubyFixnum) scalar).getDoubleValue();
|
|
543
543
|
IRubyObject[] ary = new IRubyObject[]{
|
|
544
544
|
runtime.newFloat(jx * Math.cos(theta) - jy * Math.sin(theta)),
|
|
@@ -581,7 +581,7 @@ public class Vec2 extends RubyObject {
|
|
|
581
581
|
throw runtime.newSyntaxError("Check syntax");
|
|
582
582
|
}
|
|
583
583
|
Vec2 vec = (Vec2) args[0].toJava(Vec2.class);
|
|
584
|
-
double scalar =
|
|
584
|
+
double scalar = args[1] instanceof RubyFloat
|
|
585
585
|
? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
|
|
586
586
|
assert (scalar >= 0 && scalar < 1.0) :
|
|
587
587
|
"Lerp value " + scalar + " out of range 0..1.0";
|
|
@@ -766,8 +766,8 @@ public class Vec2 extends RubyObject {
|
|
|
766
766
|
}
|
|
767
767
|
if (other instanceof Vec2) {
|
|
768
768
|
Vec2 v = (Vec2) other.toJava(Vec2.class);
|
|
769
|
-
if (
|
|
770
|
-
&&
|
|
769
|
+
if (Double.compare(jx, (Double) v.jx) == 0
|
|
770
|
+
&& Double.compare(jy, (Double) v.jy) == 0) {
|
|
771
771
|
return runtime.newBoolean(true);
|
|
772
772
|
}
|
|
773
773
|
}
|
|
@@ -793,6 +793,7 @@ public class Vec2 extends RubyObject {
|
|
|
793
793
|
double diff = jx - v.jx;
|
|
794
794
|
if ((diff < 0 ? -diff : diff) > Vec2.EPSILON) {
|
|
795
795
|
return runtime.newBoolean(false);
|
|
796
|
+
} else {
|
|
796
797
|
}
|
|
797
798
|
diff = jy - v.jy;
|
|
798
799
|
return runtime.newBoolean((diff < 0 ? -diff : diff) < Vec2.EPSILON);
|
|
@@ -65,7 +65,7 @@ public final class Vec3 extends RubyObject {
|
|
|
65
65
|
* @return new Vec3 object (ruby)
|
|
66
66
|
*/
|
|
67
67
|
@JRubyMethod(name = "new", meta = true, rest = true)
|
|
68
|
-
public
|
|
68
|
+
public static IRubyObject rbNew(ThreadContext context, IRubyObject klazz, IRubyObject... args) {
|
|
69
69
|
Vec3 vec = (Vec3) ((RubyClass) klazz).allocate();
|
|
70
70
|
vec.init(context, args);
|
|
71
71
|
return vec;
|
|
@@ -83,27 +83,27 @@ public final class Vec3 extends RubyObject {
|
|
|
83
83
|
void init(ThreadContext context, IRubyObject... args) {
|
|
84
84
|
int count = args.length;
|
|
85
85
|
if (count >= 2) {
|
|
86
|
-
jx =
|
|
86
|
+
jx = args[0] instanceof RubyFloat
|
|
87
87
|
? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
|
|
88
|
-
jy =
|
|
88
|
+
jy = args[1] instanceof RubyFloat
|
|
89
89
|
? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
|
|
90
90
|
}
|
|
91
91
|
if (count == 3) {
|
|
92
|
-
jz =
|
|
92
|
+
jz = args[2] instanceof RubyFloat
|
|
93
93
|
? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
|
|
94
94
|
} // allow ruby ducktyping in constructor
|
|
95
95
|
if (count == 1) {
|
|
96
96
|
if (!(args[0].respondsTo("x"))) {
|
|
97
97
|
throw context.runtime.newTypeError(args[0].getType() + " doesn't respond_to :x & :y");
|
|
98
98
|
}
|
|
99
|
-
jx = (
|
|
99
|
+
jx = (args[0].callMethod(context, "x")) instanceof RubyFloat
|
|
100
100
|
? ((RubyFloat) args[0].callMethod(context, "x")).getValue() : ((RubyFixnum) args[0].callMethod(context, "x")).getDoubleValue();
|
|
101
|
-
jy = (
|
|
101
|
+
jy = (args[0].callMethod(context, "y")) instanceof RubyFloat
|
|
102
102
|
? ((RubyFloat) args[0].callMethod(context, "y")).getValue() : ((RubyFixnum) args[0].callMethod(context, "y")).getDoubleValue();
|
|
103
103
|
if (!(args[0].respondsTo("z"))) {
|
|
104
104
|
return;
|
|
105
105
|
} // allow promotion from 2D to 3D, sets jz = 0
|
|
106
|
-
jz = (
|
|
106
|
+
jz = (args[0].callMethod(context, "z")) instanceof RubyFloat ? ((RubyFloat) args[0].callMethod(context, "z")).getValue() : ((RubyFixnum) args[0].callMethod(context, "z")).getDoubleValue();
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -598,9 +598,9 @@ public final class Vec3 extends RubyObject {
|
|
|
598
598
|
double u = 0;
|
|
599
599
|
double v = 0;
|
|
600
600
|
if (count == 3) {
|
|
601
|
-
u =
|
|
601
|
+
u = args[1] instanceof RubyFloat
|
|
602
602
|
? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
|
|
603
|
-
v =
|
|
603
|
+
v = args[2] instanceof RubyFloat
|
|
604
604
|
? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
|
|
605
605
|
}
|
|
606
606
|
if (count == 2) {
|
|
@@ -662,9 +662,9 @@ public final class Vec3 extends RubyObject {
|
|
|
662
662
|
}
|
|
663
663
|
if (obj instanceof Vec3) {
|
|
664
664
|
final Vec3 other = (Vec3) obj;
|
|
665
|
-
if (
|
|
666
|
-
&&
|
|
667
|
-
&&
|
|
665
|
+
if (Double.compare(jx, (Double) other.jx) == 0
|
|
666
|
+
&& Double.compare(jy, (Double) other.jy) == 0
|
|
667
|
+
&& Double.compare(jz, (Double) other.jz) == 0) {
|
|
668
668
|
return true;
|
|
669
669
|
}
|
|
670
670
|
|
|
@@ -1564,6 +1564,15 @@ public class PGraphicsJava2D extends PGraphics {
|
|
|
1564
1564
|
|
|
1565
1565
|
/**
|
|
1566
1566
|
* Handle renderer-specific image drawing.
|
|
1567
|
+
* @param who
|
|
1568
|
+
* @param x1
|
|
1569
|
+
* @param y1
|
|
1570
|
+
* @param x2
|
|
1571
|
+
* @param y2
|
|
1572
|
+
* @param u1
|
|
1573
|
+
* @param v1
|
|
1574
|
+
* @param u2
|
|
1575
|
+
* @param v2
|
|
1567
1576
|
*/
|
|
1568
1577
|
@Override
|
|
1569
1578
|
protected void imageImpl(PImage who,
|
|
@@ -2575,7 +2584,7 @@ public class PGraphicsJava2D extends PGraphics {
|
|
|
2575
2584
|
// WritableRaster raster = ((BufferedImage) image).getRaster();
|
|
2576
2585
|
// WritableRaster raster = image.getRaster();
|
|
2577
2586
|
WritableRaster raster = getRaster();
|
|
2578
|
-
if (
|
|
2587
|
+
if (clearPixels == null || clearPixels.length < imageWidth) {
|
|
2579
2588
|
clearPixels = new int[imageWidth];
|
|
2580
2589
|
}
|
|
2581
2590
|
Arrays.fill(clearPixels, 0, imageWidth, backgroundColor);
|
|
@@ -2595,7 +2604,6 @@ public class PGraphicsJava2D extends PGraphics {
|
|
|
2595
2604
|
public void backgroundImpl() {
|
|
2596
2605
|
if (backgroundAlpha) {
|
|
2597
2606
|
clearPixels(backgroundColor);
|
|
2598
|
-
|
|
2599
2607
|
} else {
|
|
2600
2608
|
Color bgColor = new Color(backgroundColor);
|
|
2601
2609
|
// seems to fire an additional event that causes flickering,
|
|
@@ -2798,7 +2806,7 @@ public class PGraphicsJava2D extends PGraphics {
|
|
|
2798
2806
|
public void updatePixels(int x, int y, int c, int d) {
|
|
2799
2807
|
//if ((x == 0) && (y == 0) && (c == width) && (d == height)) {
|
|
2800
2808
|
// System.err.format("%d %d %d %d .. w/h = %d %d .. pw/ph = %d %d %n", x, y, c, d, width, height, pixelWidth, pixelHeight);
|
|
2801
|
-
if (
|
|
2809
|
+
if (x != 0 || y != 0 || c != pixelWidth || d != pixelHeight) {
|
|
2802
2810
|
// Show a warning message, but continue anyway.
|
|
2803
2811
|
showVariationWarning("updatePixels(x, y, w, h)");
|
|
2804
2812
|
// new Exception().printStackTrace(System.out);
|
|
@@ -39,8 +39,8 @@ import java.util.zip.*;
|
|
|
39
39
|
|
|
40
40
|
// loadXML() error handling
|
|
41
41
|
import javax.xml.parsers.ParserConfigurationException;
|
|
42
|
-
import monkstone.noise.NoiseMode;
|
|
43
|
-
import monkstone.noise.Noise;
|
|
42
|
+
// import monkstone.noise.NoiseMode;
|
|
43
|
+
// import monkstone.noise.Noise;
|
|
44
44
|
import org.xml.sax.SAXException;
|
|
45
45
|
|
|
46
46
|
// TODO have this removed by 4.0 final
|
|
@@ -49,7 +49,7 @@ import processing.awt.ShimAWT;
|
|
|
49
49
|
import processing.data.*;
|
|
50
50
|
import processing.event.*;
|
|
51
51
|
import processing.opengl.*;
|
|
52
|
-
import monkstone.noise.NoiseGenerator;
|
|
52
|
+
// import monkstone.noise.NoiseGenerator;
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Base class for all sketches that use processing.core.
|
|
@@ -119,7 +119,7 @@ public class PApplet implements PConstants {
|
|
|
119
119
|
*/
|
|
120
120
|
static public boolean useNativeSelect = true;
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
// Noise noiseGenerator = new NoiseGenerator();
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* The PGraphics renderer associated with this PApplet
|
|
@@ -1000,7 +1000,7 @@ public class PApplet implements PConstants {
|
|
|
1000
1000
|
/**
|
|
1001
1001
|
* @param display the display number to check (1-indexed to match the
|
|
1002
1002
|
* Preferences dialog box)
|
|
1003
|
-
* @return
|
|
1003
|
+
* @return
|
|
1004
1004
|
*/
|
|
1005
1005
|
public int displayDensity(int display) {
|
|
1006
1006
|
if (!disableAWT) {
|
|
@@ -1962,7 +1962,7 @@ public class PApplet implements PConstants {
|
|
|
1962
1962
|
* <A HREF="http://dev.processing.org/reference/core/javadoc/processing/core/PImage.html#save(java.lang.String)">PImage.save()</A>.
|
|
1963
1963
|
* </UL>
|
|
1964
1964
|
*
|
|
1965
|
-
* @return
|
|
1965
|
+
* @return
|
|
1966
1966
|
* @webref rendering
|
|
1967
1967
|
* @param w width in pixels
|
|
1968
1968
|
* @param h height in pixels
|
|
@@ -1982,7 +1982,7 @@ public class PApplet implements PConstants {
|
|
|
1982
1982
|
* @param path the name of the file (can be an absolute or relative path)
|
|
1983
1983
|
* @param renderer
|
|
1984
1984
|
* @param h
|
|
1985
|
-
* @return
|
|
1985
|
+
* @return
|
|
1986
1986
|
*/
|
|
1987
1987
|
public PGraphics createGraphics(int w, int h,
|
|
1988
1988
|
String renderer, String path) {
|
|
@@ -2011,7 +2011,7 @@ public class PApplet implements PConstants {
|
|
|
2011
2011
|
* @param path A path (or null if none), can be absolute or relative
|
|
2012
2012
|
* ({@link PApplet#savePath} will be called)
|
|
2013
2013
|
* @param primary
|
|
2014
|
-
* @return
|
|
2014
|
+
* @return
|
|
2015
2015
|
*/
|
|
2016
2016
|
protected PGraphics makeGraphics(int w, int h,
|
|
2017
2017
|
String renderer, String path,
|
|
@@ -2956,7 +2956,7 @@ public class PApplet implements PConstants {
|
|
|
2956
2956
|
* This is a function, rather than a variable, because it may change
|
|
2957
2957
|
* multiple times per frame.
|
|
2958
2958
|
*
|
|
2959
|
-
* @return
|
|
2959
|
+
* @return
|
|
2960
2960
|
* @webref input:time_date
|
|
2961
2961
|
* @see PApplet#second()
|
|
2962
2962
|
* @see PApplet#minute()
|
|
@@ -4916,83 +4916,83 @@ public class PApplet implements PConstants {
|
|
|
4916
4916
|
* @see PApplet#noise(float, float, float)
|
|
4917
4917
|
* @see PApplet#noiseSeed(long)
|
|
4918
4918
|
*/
|
|
4919
|
-
public final void randomSeed(long seed) {
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
}
|
|
4925
|
-
|
|
4926
|
-
public void noiseMode(NoiseMode mode) {
|
|
4927
|
-
|
|
4928
|
-
}
|
|
4929
|
-
|
|
4930
|
-
/**
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
public float noise(float x) {
|
|
4935
|
-
|
|
4936
|
-
}
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
public float noise(float x, float y) {
|
|
4944
|
-
|
|
4945
|
-
}
|
|
4946
|
-
|
|
4947
|
-
/**
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
public float noise(float x, float y, float z) {
|
|
4983
|
-
|
|
4984
|
-
}
|
|
4985
|
-
/**
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
public float noise(float x, float y, float z, float w) {
|
|
4994
|
-
|
|
4995
|
-
}
|
|
4919
|
+
// public final void randomSeed(long seed) {
|
|
4920
|
+
// if (internalRandom == null) {
|
|
4921
|
+
// internalRandom = new Random();
|
|
4922
|
+
// }
|
|
4923
|
+
// internalRandom.setSeed(seed);
|
|
4924
|
+
// }
|
|
4925
|
+
//
|
|
4926
|
+
// public void noiseMode(NoiseMode mode) {
|
|
4927
|
+
// noiseGenerator.noiseMode(mode);
|
|
4928
|
+
// }
|
|
4929
|
+
//
|
|
4930
|
+
// /**
|
|
4931
|
+
// * @param x
|
|
4932
|
+
// * @return
|
|
4933
|
+
// */
|
|
4934
|
+
// public float noise(float x) {
|
|
4935
|
+
// return noiseGenerator.noise(x);
|
|
4936
|
+
// }
|
|
4937
|
+
//
|
|
4938
|
+
// /**
|
|
4939
|
+
// * @param x
|
|
4940
|
+
// * @param y
|
|
4941
|
+
// * @return
|
|
4942
|
+
// */
|
|
4943
|
+
// public float noise(float x, float y) {
|
|
4944
|
+
// return noiseGenerator.noise(x, y);
|
|
4945
|
+
// }
|
|
4946
|
+
//
|
|
4947
|
+
// /**
|
|
4948
|
+
// * ( begin auto-generated from noise.xml )
|
|
4949
|
+
// *
|
|
4950
|
+
// * Returns the Perlin noise value at specified coordinates. Perlin noise is
|
|
4951
|
+
// * a random sequence generator producing a more natural ordered, harmonic
|
|
4952
|
+
// * succession of numbers compared to the standard <b>random()</b> function.
|
|
4953
|
+
// * It was invented by Ken Perlin in the 1980s and been used since in
|
|
4954
|
+
// * graphical applications to produce procedural textures, natural motion,
|
|
4955
|
+
// * shapes, terrains etc. The main difference to the
|
|
4956
|
+
// * <b>random()</b> function is that Perlin noise is defined in an infinite
|
|
4957
|
+
// * n-dimensional space where each pair of coordinates corresponds to a fixed
|
|
4958
|
+
// * semi-random value (fixed only for the lifespan of the program). The
|
|
4959
|
+
// * resulting value will always be between 0.0 and 1.0. Processing can
|
|
4960
|
+
// * compute 1D, 2D and 3D noise, depending on the number of coordinates
|
|
4961
|
+
// * given. The noise value can be animated by moving through the noise space
|
|
4962
|
+
// * as demonstrated in the example above. The 2nd and 3rd dimension can also
|
|
4963
|
+
// * be interpreted as time.The actual noise is structured similar to an audio
|
|
4964
|
+
// * signal, in respect to the function's use of frequencies. Similar to the
|
|
4965
|
+
// * concept of harmonics in physics, perlin noise is computed over several
|
|
4966
|
+
// * octaves which are added together for the final result. Another way to
|
|
4967
|
+
// * adjust the character of the resulting sequence is the scale of the input
|
|
4968
|
+
// * coordinates. As the function works within an infinite space the value of
|
|
4969
|
+
// * the coordinates doesn't matter as such, only the distance between
|
|
4970
|
+
// * successive coordinates does (eg. when using <b>noise()</b> within a
|
|
4971
|
+
// * loop). As a general rule the smaller the difference between coordinates,
|
|
4972
|
+
// * the smoother the resulting noise sequence will be. Steps of 0.005-0.03
|
|
4973
|
+
// * work best for most applications, but this will differ depending on use.
|
|
4974
|
+
// *
|
|
4975
|
+
// * ( end auto-generated )
|
|
4976
|
+
// *
|
|
4977
|
+
// * @webref math:random
|
|
4978
|
+
// * @param x x-coordinate in noise space
|
|
4979
|
+
// * @param y y-coordinate in noise space
|
|
4980
|
+
// * @param z z-coordinate in noise space
|
|
4981
|
+
// */
|
|
4982
|
+
// public float noise(float x, float y, float z) {
|
|
4983
|
+
// return noiseGenerator.noise(x, y, z);
|
|
4984
|
+
// }
|
|
4985
|
+
// /**
|
|
4986
|
+
// * 4D noise where typically w is time
|
|
4987
|
+
// * @param x
|
|
4988
|
+
// * @param y
|
|
4989
|
+
// * @param z
|
|
4990
|
+
// * @param w
|
|
4991
|
+
// * @return
|
|
4992
|
+
// */
|
|
4993
|
+
// public float noise(float x, float y, float z, float w) {
|
|
4994
|
+
// return noiseGenerator.noise(x, y, z, w);
|
|
4995
|
+
// }
|
|
4996
4996
|
|
|
4997
4997
|
/**
|
|
4998
4998
|
*
|
|
@@ -5030,9 +5030,9 @@ public class PApplet implements PConstants {
|
|
|
5030
5030
|
* @see PApplet#random(float,float)
|
|
5031
5031
|
* @see PApplet#randomSeed(long)
|
|
5032
5032
|
*/
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5033
|
+
// public void noiseSeed(long seed) {
|
|
5034
|
+
// noiseGenerator.noiseSeed(seed);
|
|
5035
|
+
// }
|
|
5036
5036
|
|
|
5037
5037
|
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
|
5038
5038
|
/**
|