picrate 1.3.0-java → 2.1.2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/wrapper/MavenWrapperDownloader.java +1 -1
  3. data/CHANGELOG.md +10 -1
  4. data/Gemfile +3 -1
  5. data/README.md +9 -6
  6. data/Rakefile +8 -3
  7. data/bin/picrate +3 -1
  8. data/docs/_config.yml +1 -1
  9. data/docs/_editors/geany.md +1 -0
  10. data/docs/_gems/gems/gems.md +1 -1
  11. data/docs/_methods/alternative_methods.md +2 -1
  12. data/docs/_posts/2018-05-06-getting_started.md +4 -4
  13. data/docs/_posts/2018-05-06-install_jruby.md +5 -11
  14. data/docs/_posts/2018-05-11-arch-linux-arm.md +1 -11
  15. data/docs/_posts/2018-11-18-building-gem.md +2 -2
  16. data/docs/_posts/2018-11-27-getting_started_geany.md +1 -1
  17. data/docs/_posts/2019-11-11-getting_started_buster.md +3 -6
  18. data/docs/_posts/{2018-06-26-auto_install_picrate.md → 2020-03-09-auto_install_picrate.md} +9 -6
  19. data/docs/_posts/2020-05-11-getting_started_manjaro.md +106 -0
  20. data/docs/about.md +1 -1
  21. data/lib/picrate.rb +3 -2
  22. data/lib/picrate/app.rb +11 -3
  23. data/lib/picrate/creators/parameters.rb +8 -8
  24. data/lib/picrate/creators/sketch_factory.rb +5 -3
  25. data/lib/picrate/helper_methods.rb +22 -22
  26. data/lib/picrate/helpers/numeric.rb +2 -0
  27. data/lib/picrate/library.rb +5 -1
  28. data/lib/picrate/library_loader.rb +2 -0
  29. data/lib/picrate/native_folder.rb +2 -1
  30. data/lib/picrate/native_loader.rb +3 -0
  31. data/lib/picrate/runner.rb +5 -4
  32. data/lib/picrate/version.rb +1 -1
  33. data/library/boids/boids.rb +17 -8
  34. data/library/chooser/chooser.rb +10 -9
  35. data/library/color_group/color_group.rb +2 -0
  36. data/library/control_panel/control_panel.rb +7 -4
  37. data/library/dxf/dxf.rb +2 -0
  38. data/library/jcomplex/jcomplex.rb +1 -0
  39. data/library/library_proxy/library_proxy.rb +2 -0
  40. data/library/net/net.rb +2 -0
  41. data/library/slider/slider.rb +24 -23
  42. data/library/vector_utils/vector_utils.rb +4 -0
  43. data/library/video_event/video_event.rb +2 -0
  44. data/mvnw +2 -2
  45. data/mvnw.cmd +2 -2
  46. data/picrate.gemspec +13 -13
  47. data/pom.rb +26 -23
  48. data/pom.xml +19 -7
  49. data/src/main/java/monkstone/ColorUtil.java +1 -1
  50. data/src/main/java/monkstone/MathToolModule.java +1 -1
  51. data/src/main/java/monkstone/PicrateLibrary.java +8 -8
  52. data/src/main/java/monkstone/complex/JComplex.java +252 -0
  53. data/src/main/java/monkstone/fastmath/Deglut.java +16 -16
  54. data/src/main/java/monkstone/filechooser/Chooser.java +1 -1
  55. data/src/main/java/monkstone/noise/SimplexNoise.java +3 -3
  56. data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +1 -1
  57. data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
  58. data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +12 -12
  59. data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +1 -1
  60. data/src/main/java/monkstone/slider/SliderBar.java +1 -1
  61. data/src/main/java/monkstone/slider/SliderGroup.java +1 -1
  62. data/src/main/java/monkstone/slider/WheelHandler.java +1 -1
  63. data/src/main/java/monkstone/vecmath/package-info.java +1 -1
  64. data/src/main/java/monkstone/vecmath/vec2/Vec2.java +1 -1
  65. data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -1
  66. data/src/main/java/monkstone/videoevent/CaptureEvent.java +1 -1
  67. data/src/main/java/monkstone/videoevent/MovieEvent.java +1 -1
  68. data/src/main/java/monkstone/videoevent/package-info.java +1 -1
  69. data/src/main/java/processing/awt/PGraphicsJava2D.java +33 -36
  70. data/src/main/java/processing/awt/PImageAWT.java +377 -0
  71. data/src/main/java/processing/awt/PSurfaceAWT.java +0 -20
  72. data/src/main/java/processing/awt/ShimAWT.java +545 -0
  73. data/src/main/java/processing/core/PApplet.java +699 -1523
  74. data/src/main/java/processing/core/PConstants.java +180 -180
  75. data/src/main/java/processing/core/PFont.java +2 -2
  76. data/src/main/java/processing/core/PGraphics.java +190 -176
  77. data/src/main/java/processing/core/PImage.java +1536 -1721
  78. data/src/main/java/processing/core/PMatrix.java +39 -39
  79. data/src/main/java/processing/core/PSurface.java +69 -103
  80. data/src/main/java/processing/core/PSurfaceNone.java +29 -0
  81. data/src/main/java/processing/core/PVector.java +2 -2
  82. data/src/main/java/processing/data/FloatDict.java +251 -284
  83. data/src/main/java/processing/data/TableRow.java +32 -32
  84. data/src/main/java/processing/dxf/RawDXF.java +3 -3
  85. data/src/main/java/processing/net/Client.java +1 -1
  86. data/src/main/java/processing/opengl/PGL.java +1016 -4132
  87. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +232 -176
  88. data/src/main/java/processing/opengl/PJOGL.java +374 -1526
  89. data/src/main/java/processing/opengl/PShapeOpenGL.java +5 -6
  90. data/src/main/java/processing/opengl/PSurfaceJOGL.java +262 -147
  91. data/test/color_group_test.rb +4 -4
  92. data/test/deglut_spec_test.rb +2 -0
  93. data/test/helper_methods_test.rb +41 -13
  94. data/test/math_tool_test.rb +46 -37
  95. data/test/respond_to_test.rb +5 -3
  96. data/test/sketches/key_event.rb +2 -2
  97. data/test/sketches/library/my_library/my_library.rb +3 -0
  98. data/test/test_helper.rb +2 -0
  99. data/test/vecmath_spec_test.rb +30 -19
  100. data/vendors/Rakefile +33 -21
  101. data/vendors/{picrate_sketches.geany → geany.rb} +32 -7
  102. metadata +27 -46
  103. data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +0 -154
  104. data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +0 -154
  105. data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +0 -160
  106. data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +0 -160
@@ -1,160 +0,0 @@
1
- /*
2
- Part of the Processing project - http://processing.org
3
-
4
- Copyright (c) 2012-15 The Processing Foundation
5
- Copyright (c) 2004-12 Ben Fry and Casey Reas
6
- Copyright (c) 2001-04 Massachusetts Institute of Technology
7
-
8
- This library is free software; you can redistribute it and/or
9
- modify it under the terms of the GNU Lesser General Public
10
- License as published by the Free Software Foundation, version 2.1.
11
-
12
- This library is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- Lesser General Public License for more details.
16
-
17
- You should have received a copy of the GNU Lesser General
18
- Public License along with this library; if not, write to the
19
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20
- Boston, MA 02111-1307 USA
21
- */
22
-
23
- uniform mat4 modelviewMatrix;
24
- uniform mat4 transformMatrix;
25
- uniform mat3 normalMatrix;
26
- uniform mat4 texMatrix;
27
-
28
- uniform int lightCount;
29
- uniform vec4 lightPosition[8];
30
- uniform vec3 lightNormal[8];
31
- uniform vec3 lightAmbient[8];
32
- uniform vec3 lightDiffuse[8];
33
- uniform vec3 lightSpecular[8];
34
- uniform vec3 lightFalloff[8];
35
- uniform vec2 lightSpot[8];
36
-
37
- attribute vec4 position;
38
- attribute vec4 color;
39
- attribute vec3 normal;
40
- attribute vec2 texCoord;
41
-
42
- attribute vec4 ambient;
43
- attribute vec4 specular;
44
- attribute vec4 emissive;
45
- attribute float shininess;
46
-
47
- varying vec4 vertColor;
48
- varying vec4 backVertColor;
49
- varying vec4 vertTexCoord;
50
-
51
- const float zero_float = 0.0;
52
- const float one_float = 1.0;
53
- const vec3 zero_vec3 = vec3(0.0);
54
- const vec3 minus_one_vec3 = vec3(0.0-1.0);
55
-
56
- float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) {
57
- vec3 lpv = lightPos - vertPos;
58
- vec3 dist = vec3(one_float);
59
- dist.z = dot(lpv, lpv);
60
- dist.y = sqrt(dist.z);
61
- return one_float / dot(dist, coeff);
62
- }
63
-
64
- float spotFactor(vec3 lightPos, vec3 vertPos, vec3 lightNorm, float minCos, float spotExp) {
65
- vec3 lpv = normalize(lightPos - vertPos);
66
- vec3 nln = minus_one_vec3 * lightNorm;
67
- float spotCos = dot(nln, lpv);
68
- return spotCos <= minCos ? zero_float : pow(spotCos, spotExp);
69
- }
70
-
71
- float lambertFactor(vec3 lightDir, vec3 vecNormal) {
72
- return max(zero_float, dot(lightDir, vecNormal));
73
- }
74
-
75
- float blinnPhongFactor(vec3 lightDir, vec3 vertPos, vec3 vecNormal, float shine) {
76
- vec3 np = normalize(vertPos);
77
- vec3 ldp = normalize(lightDir - np);
78
- return pow(max(zero_float, dot(ldp, vecNormal)), shine);
79
- }
80
-
81
- void main() {
82
- // Vertex in clip coordinates
83
- gl_Position = transformMatrix * position;
84
-
85
- // Vertex in eye coordinates
86
- vec3 ecVertex = vec3(modelviewMatrix * position);
87
-
88
- // Normal vector in eye coordinates
89
- vec3 ecNormal = normalize(normalMatrix * normal);
90
- vec3 ecNormalInv = ecNormal * minus_one_vec3;
91
-
92
- // Light calculations
93
- vec3 totalAmbient = vec3(0, 0, 0);
94
-
95
- vec3 totalFrontDiffuse = vec3(0, 0, 0);
96
- vec3 totalFrontSpecular = vec3(0, 0, 0);
97
-
98
- vec3 totalBackDiffuse = vec3(0, 0, 0);
99
- vec3 totalBackSpecular = vec3(0, 0, 0);
100
-
101
- // prevent register allocation failure by limiting ourselves to
102
- // two lights for now
103
- for (int i = 0; i < 2; i++) {
104
- if (lightCount == i) break;
105
-
106
- vec3 lightPos = lightPosition[i].xyz;
107
- bool isDir = lightPosition[i].w < one_float;
108
- float spotCos = lightSpot[i].x;
109
- float spotExp = lightSpot[i].y;
110
-
111
- vec3 lightDir;
112
- float falloff;
113
- float spotf;
114
-
115
- if (isDir) {
116
- falloff = one_float;
117
- lightDir = minus_one_vec3 * lightNormal[i];
118
- } else {
119
- falloff = falloffFactor(lightPos, ecVertex, lightFalloff[i]);
120
- lightDir = normalize(lightPos - ecVertex);
121
- }
122
-
123
- spotf = spotExp > zero_float ? spotFactor(lightPos, ecVertex, lightNormal[i],
124
- spotCos, spotExp)
125
- : one_float;
126
-
127
- if (any(greaterThan(lightAmbient[i], zero_vec3))) {
128
- totalAmbient += lightAmbient[i] * falloff;
129
- }
130
-
131
- if (any(greaterThan(lightDiffuse[i], zero_vec3))) {
132
- totalFrontDiffuse += lightDiffuse[i] * falloff * spotf *
133
- lambertFactor(lightDir, ecNormal);
134
- totalBackDiffuse += lightDiffuse[i] * falloff * spotf *
135
- lambertFactor(lightDir, ecNormalInv);
136
- }
137
-
138
- if (any(greaterThan(lightSpecular[i], zero_vec3))) {
139
- totalFrontSpecular += lightSpecular[i] * falloff * spotf *
140
- blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess);
141
- totalBackSpecular += lightSpecular[i] * falloff * spotf *
142
- blinnPhongFactor(lightDir, ecVertex, ecNormalInv, shininess);
143
- }
144
- }
145
-
146
- // Calculating final color as result of all lights (plus emissive term).
147
- // Transparency is determined exclusively by the diffuse component.
148
- vertColor = vec4(totalAmbient, 0) * ambient +
149
- vec4(totalFrontDiffuse, 1) * color +
150
- vec4(totalFrontSpecular, 0) * specular +
151
- vec4(emissive.rgb, 0);
152
-
153
- backVertColor = vec4(totalAmbient, 0) * ambient +
154
- vec4(totalBackDiffuse, 1) * color +
155
- vec4(totalBackSpecular, 0) * specular +
156
- vec4(emissive.rgb, 0);
157
-
158
- // Calculating texture coordinates, with r and q set both to one
159
- vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0);
160
- }
@@ -1,160 +0,0 @@
1
- /*
2
- Part of the Processing project - http://processing.org
3
-
4
- Copyright (c) 2012-15 The Processing Foundation
5
- Copyright (c) 2004-12 Ben Fry and Casey Reas
6
- Copyright (c) 2001-04 Massachusetts Institute of Technology
7
-
8
- This library is free software; you can redistribute it and/or
9
- modify it under the terms of the GNU Lesser General Public
10
- License as published by the Free Software Foundation, version 2.1.
11
-
12
- This library is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- Lesser General Public License for more details.
16
-
17
- You should have received a copy of the GNU Lesser General
18
- Public License along with this library; if not, write to the
19
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20
- Boston, MA 02111-1307 USA
21
- */
22
-
23
- uniform mat4 modelviewMatrix;
24
- uniform mat4 transformMatrix;
25
- uniform mat3 normalMatrix;
26
- uniform mat4 texMatrix;
27
-
28
- uniform int lightCount;
29
- uniform vec4 lightPosition[8];
30
- uniform vec3 lightNormal[8];
31
- uniform vec3 lightAmbient[8];
32
- uniform vec3 lightDiffuse[8];
33
- uniform vec3 lightSpecular[8];
34
- uniform vec3 lightFalloff[8];
35
- uniform vec2 lightSpot[8];
36
-
37
- attribute vec4 position;
38
- attribute vec4 color;
39
- attribute vec3 normal;
40
- attribute vec2 texCoord;
41
-
42
- attribute vec4 ambient;
43
- attribute vec4 specular;
44
- attribute vec4 emissive;
45
- attribute float shininess;
46
-
47
- varying vec4 vertColor;
48
- varying vec4 backVertColor;
49
- varying vec4 vertTexCoord;
50
-
51
- const float zero_float = 0.0;
52
- const float one_float = 1.0;
53
- const vec3 zero_vec3 = vec3(0.0);
54
- const vec3 minus_one_vec3 = vec3(0.0-1.0);
55
-
56
- float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) {
57
- vec3 lpv = lightPos - vertPos;
58
- vec3 dist = vec3(one_float);
59
- dist.z = dot(lpv, lpv);
60
- dist.y = sqrt(dist.z);
61
- return one_float / dot(dist, coeff);
62
- }
63
-
64
- float spotFactor(vec3 lightPos, vec3 vertPos, vec3 lightNorm, float minCos, float spotExp) {
65
- vec3 lpv = normalize(lightPos - vertPos);
66
- vec3 nln = minus_one_vec3 * lightNorm;
67
- float spotCos = dot(nln, lpv);
68
- return spotCos <= minCos ? zero_float : pow(spotCos, spotExp);
69
- }
70
-
71
- float lambertFactor(vec3 lightDir, vec3 vecNormal) {
72
- return max(zero_float, dot(lightDir, vecNormal));
73
- }
74
-
75
- float blinnPhongFactor(vec3 lightDir, vec3 vertPos, vec3 vecNormal, float shine) {
76
- vec3 np = normalize(vertPos);
77
- vec3 ldp = normalize(lightDir - np);
78
- return pow(max(zero_float, dot(ldp, vecNormal)), shine);
79
- }
80
-
81
- void main() {
82
- // Vertex in clip coordinates
83
- gl_Position = transformMatrix * position;
84
-
85
- // Vertex in eye coordinates
86
- vec3 ecVertex = vec3(modelviewMatrix * position);
87
-
88
- // Normal vector in eye coordinates
89
- vec3 ecNormal = normalize(normalMatrix * normal);
90
- vec3 ecNormalInv = ecNormal * minus_one_vec3;
91
-
92
- // Light calculations
93
- vec3 totalAmbient = vec3(0, 0, 0);
94
-
95
- vec3 totalFrontDiffuse = vec3(0, 0, 0);
96
- vec3 totalFrontSpecular = vec3(0, 0, 0);
97
-
98
- vec3 totalBackDiffuse = vec3(0, 0, 0);
99
- vec3 totalBackSpecular = vec3(0, 0, 0);
100
-
101
- // prevent register allocation failure by limiting ourselves to
102
- // four lights for now
103
- for (int i = 0; i < 4; i++) {
104
- if (lightCount == i) break;
105
-
106
- vec3 lightPos = lightPosition[i].xyz;
107
- bool isDir = lightPosition[i].w < one_float;
108
- float spotCos = lightSpot[i].x;
109
- float spotExp = lightSpot[i].y;
110
-
111
- vec3 lightDir;
112
- float falloff;
113
- float spotf;
114
-
115
- if (isDir) {
116
- falloff = one_float;
117
- lightDir = minus_one_vec3 * lightNormal[i];
118
- } else {
119
- falloff = falloffFactor(lightPos, ecVertex, lightFalloff[i]);
120
- lightDir = normalize(lightPos - ecVertex);
121
- }
122
-
123
- spotf = spotExp > zero_float ? spotFactor(lightPos, ecVertex, lightNormal[i],
124
- spotCos, spotExp)
125
- : one_float;
126
-
127
- if (any(greaterThan(lightAmbient[i], zero_vec3))) {
128
- totalAmbient += lightAmbient[i] * falloff;
129
- }
130
-
131
- if (any(greaterThan(lightDiffuse[i], zero_vec3))) {
132
- totalFrontDiffuse += lightDiffuse[i] * falloff * spotf *
133
- lambertFactor(lightDir, ecNormal);
134
- totalBackDiffuse += lightDiffuse[i] * falloff * spotf *
135
- lambertFactor(lightDir, ecNormalInv);
136
- }
137
-
138
- if (any(greaterThan(lightSpecular[i], zero_vec3))) {
139
- totalFrontSpecular += lightSpecular[i] * falloff * spotf *
140
- blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess);
141
- totalBackSpecular += lightSpecular[i] * falloff * spotf *
142
- blinnPhongFactor(lightDir, ecVertex, ecNormalInv, shininess);
143
- }
144
- }
145
-
146
- // Calculating final color as result of all lights (plus emissive term).
147
- // Transparency is determined exclusively by the diffuse component.
148
- vertColor = vec4(totalAmbient, 0) * ambient +
149
- vec4(totalFrontDiffuse, 1) * color +
150
- vec4(totalFrontSpecular, 0) * specular +
151
- vec4(emissive.rgb, 0);
152
-
153
- backVertColor = vec4(totalAmbient, 0) * ambient +
154
- vec4(totalBackDiffuse, 1) * color +
155
- vec4(totalBackSpecular, 0) * specular +
156
- vec4(emissive.rgb, 0);
157
-
158
- // Calculating texture coordinates, with r and q set both to one
159
- vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0);
160
- }