picrate 2.4.0-java → 2.5.1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/wrapper/maven-wrapper.properties +1 -1
  3. data/CHANGELOG.md +9 -1
  4. data/Gemfile +1 -1
  5. data/README.md +2 -2
  6. data/Rakefile +1 -1
  7. data/docs/.gitignore +1 -0
  8. data/docs/_classes/{app_render → gfx_render}/app_render.md +5 -5
  9. data/docs/_methods/{noise_mode.md → noise_modes.md} +9 -21
  10. data/docs/_posts/2018-05-06-install_jruby.md +5 -5
  11. data/docs/_posts/2019-11-11-getting_started_buster.md +2 -2
  12. data/docs/_posts/2020-05-11-getting_started_manjaro.md +13 -4
  13. data/docs/about.md +1 -1
  14. data/lib/picrate/app.rb +2 -8
  15. data/lib/picrate/helper_methods.rb +6 -6
  16. data/lib/picrate/native_folder.rb +1 -1
  17. data/lib/picrate/version.rb +1 -1
  18. data/lib/{picrate-2.4.0.jar → picrate-2.5.1.jar} +0 -0
  19. data/picrate.gemspec +1 -1
  20. data/pom.rb +4 -4
  21. data/pom.xml +6 -9
  22. data/src/main/java/monkstone/FastNoiseModuleJava.java +19 -19
  23. data/src/main/java/monkstone/SmoothNoiseModuleJava.java +19 -19
  24. data/src/main/java/monkstone/noise/OpenSimplex2F.java +838 -737
  25. data/src/main/java/monkstone/noise/OpenSimplex2S.java +1 -1
  26. data/src/main/java/monkstone/vecmath/GfxRender.java +10 -11
  27. data/src/main/java/monkstone/vecmath/JRender.java +7 -7
  28. data/src/main/java/monkstone/vecmath/ShapeRender.java +3 -4
  29. data/src/main/java/monkstone/vecmath/vec2/Vec2.java +28 -40
  30. data/src/main/java/monkstone/vecmath/vec3/Vec3.java +30 -45
  31. data/src/main/java/processing/awt/PImageAWT.java +1 -1
  32. data/src/main/java/processing/awt/ShimAWT.java +1 -1
  33. data/src/main/java/processing/core/PApplet.java +1 -1
  34. data/src/main/java/processing/core/PImage.java +14 -14
  35. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -13
  36. data/src/main/java/processing/opengl/PShader.java +0 -6
  37. data/src/main/java/processing/opengl/PSurfaceJOGL.java +4 -4
  38. data/src/main/{java/processing/opengl → resources}/cursors/arrow.png +0 -0
  39. data/src/main/{java/processing/opengl → resources}/cursors/cross.png +0 -0
  40. data/src/main/{java/processing/opengl → resources}/cursors/hand.png +0 -0
  41. data/src/main/{java/processing/opengl → resources}/cursors/license.txt +0 -0
  42. data/src/main/{java/processing/opengl → resources}/cursors/move.png +0 -0
  43. data/src/main/{java/processing/opengl → resources}/cursors/text.png +0 -0
  44. data/src/main/{java/processing/opengl → resources}/cursors/wait.png +0 -0
  45. data/src/main/{java/processing/opengl → resources}/shaders/ColorFrag.glsl +0 -0
  46. data/src/main/{java/processing/opengl → resources}/shaders/ColorVert.glsl +0 -0
  47. data/src/main/{java/processing/opengl → resources}/shaders/LightFrag.glsl +0 -0
  48. data/src/main/{java/processing/opengl → resources}/shaders/LightVert.glsl +0 -0
  49. data/src/main/{java/processing/opengl → resources}/shaders/LineFrag.glsl +0 -0
  50. data/src/main/{java/processing/opengl → resources}/shaders/LineVert.glsl +0 -0
  51. data/src/main/{java/processing/opengl → resources}/shaders/MaskFrag.glsl +0 -0
  52. data/src/main/{java/processing/opengl → resources}/shaders/PointFrag.glsl +0 -0
  53. data/src/main/{java/processing/opengl → resources}/shaders/PointVert.glsl +0 -0
  54. data/src/main/{java/processing/opengl → resources}/shaders/TexFrag.glsl +0 -0
  55. data/src/main/{java/processing/opengl → resources}/shaders/TexLightFrag.glsl +0 -0
  56. data/src/main/{java/processing/opengl → resources}/shaders/TexLightVert.glsl +0 -0
  57. data/src/main/{java/processing/opengl → resources}/shaders/TexVert.glsl +0 -0
  58. data/test/noise_test.rb +17 -0
  59. data/test/test_helper.rb +1 -1
  60. data/vendors/Rakefile +1 -1
  61. metadata +30 -41
  62. data/src/main/java/japplemenubar/JAppleMenuBar.java +0 -96
  63. data/src/main/java/japplemenubar/libjAppleMenuBar.jnilib +0 -0
  64. data/src/main/java/monkstone/complex/JComplex.java +0 -252
  65. data/src/main/java/monkstone/vecmath/AppRender.java +0 -88
  66. data/src/main/java/monkstone/vecmath/package-info.java +0 -20
  67. data/src/main/java/monkstone/vecmath/vec2/package-info.java +0 -6
  68. data/src/main/java/monkstone/vecmath/vec3/package-info.java +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 648440446709f65ab3078f0a76525114d496e740b9e6584869bfd7c975017096
4
- data.tar.gz: d31bd972a3e7b362319bffbbd0a5374c9e0112a76be8cae66037217561353065
3
+ metadata.gz: b3f8a1c6f427e8d6496ffa52f10da57bc8763f8dd92d52074652409658684fba
4
+ data.tar.gz: b0e3cf6d3c457bea3fdda0642d10c0a443528752b13e1ac2dd767f2bb3c0798a
5
5
  SHA512:
6
- metadata.gz: 5baa9ec19140c192d992773b1f37618d67332ac5917ee0f14e6198612c380b4997908ce32ff8f2f81cabf9fd48b739bb40a2e4eccc3f7172388541599c7e4fb6
7
- data.tar.gz: 828d1c8aa7e31cfd47c0f4a73307cbc7e962e1e1f8860e256d2e4591ab8933391841c8a3df9b22e3de1f0cf80d7d6c67fdc3234433e21c1c4f8de98b6f6db468
6
+ metadata.gz: 1de09c1115c514a845a63b00d777784550c2d1a1c20662ed59974727460652927ab7706d7380433cea31fd1f7d67c7b31f494bd566b990c9e94152120766b543
7
+ data.tar.gz: 290f982b1b70b41e58de89182b2603f96c6276f1381d19f10b5d3827aebea20f81af3c609cb07fda2a662a21b02dae5ce72dbd18b9adda12970bf0eca87865c8
@@ -1,2 +1,2 @@
1
- distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
1
+ distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.3/apache-maven-3.8.3-bin.zip
2
2
  wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ v2.5.1 Update to JRuby-9.3.1.0, under the hood changes in how we access java fields, no using `field` in place of `declared_field`, possible since JRuby-9.3.0.0 required since JRuby-9.3.1.0.
2
+
3
+ v2.5.0 Update to JRuby-9.3.0.0.
4
+
5
+ v2.4.2 Update to JRuby-9.2.19, getting ready for JRuby-9.3+.
6
+
7
+ v2.4.1 patch library loader, add PGS library examples.
8
+
1
9
  v2.4.0 Refactor noise to two modules, FastNoise (default) & SmoothNoise, with terrain noise `:tnoise` option.
2
10
 
3
11
  v2.3.0 Abandon Processing Value Noise in favour of OpenSimplex2, with choosable options. Added pdf library using iText5.
@@ -36,7 +44,7 @@ v0.8.0 Refactor processing code to jdk8 syntax, include lambda, switch on string
36
44
 
37
45
  v0.7.1 Oops fix `GfxRender` had not been merged
38
46
 
39
- v0.7.0 Refactor sketch_writer to load params from ~/.picrate/sketch.yml. `AppRender => GfxRender` because we only need `PGraphics` in renderer.
47
+ v0.7.0 Refactor sketch_writer to load params from ~/.picrate/sketch.yml. `GfxRender => GfxRender` because we only need `PGraphics` in renderer.
40
48
 
41
49
  v0.6.0 Re-branding with new 'pick'/'eight' svg for PiCrate
42
50
 
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  source 'https://rubygems.org'
4
- ruby '2.5.7', engine: 'jruby', engine_version: '9.2.11.0'
4
+ ruby '2.6.8', engine: 'jruby', engine_version: '9.3.0.0'
5
5
  gemspec
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  __C6H3N3O7__ [![Gem Version](https://badge.fury.io/rb/picrate.svg)](https://badge.fury.io/rb/picrate)![Travis CI](https://travis-ci.org/ruby-processing/PiCrate.svg)
2
2
 
3
3
  # PiCrate
4
- New version for `Buster` on raspberryPI 3B+ works with jdk11 (reflective access warnings fixed for jdk11). Since version 2.0.1 also works on 64 bit Manjaro distro on RaspberryPI4. Create processing sketches in ruby on raspberry-pi and linux (this project is a parallel development of [propane][propane] targetting the raspberry-pi, but will initially be developed on a regular linux box). The aim is to produce a gem installable app that can be run with jruby, with minimal dependencies. Drop the `C` and you get pirate, or and an `e` and get `PiCreate`, a happy coincidence?
4
+ Version for `Raspberry Pi OS` on raspberryPI 3B+ works with jdk11 (reflective access warnings fixed for jdk11). That also works on 64 bit `ManjaroArm` distro on RaspberryPI4. Create processing sketches in ruby on raspberry-pi and linux (this project is a parallel development of [propane][propane] targetting the raspberry-pi, but will initially be developed on a regular linux box). The aim is to produce a gem installable app that can be run with jruby, with minimal dependencies. Drop the `C` and you get pirate, or and an `e` and get `PiCreate`, a happy coincidence?
5
5
 
6
6
 
7
7
  ### To install from rubygems ###
@@ -19,7 +19,7 @@ Requires java to build (and [jogl-2.4.0-rc jars][jogl_jars]), but uses a maven w
19
19
  ```bash
20
20
  cd PiCrate # or whatever you call it
21
21
  rake # assumes an installed version of vanilla processing
22
- jgem install picrate-2.4.0-java.gem
22
+ jgem install picrate-2.5.1-java.gem
23
23
 
24
24
  ```
25
25
  To create a template sketch:-
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ task default: %i[init compile install test gem]
9
9
  # Currently depends on local jogl-2.4.0 jars on path ~/jogl24
10
10
  desc 'Copy Jars'
11
11
  task :init do
12
- jogl24 = File.join(HOME_DIR, 'jogl-2.4-rc2021011')
12
+ jogl24 = File.join(HOME_DIR, 'jogl24')
13
13
  opengl = Dir.entries(jogl24).grep(/amd64|armv6hf|aarch64/).select { |jar| jar =~ /linux/ }
14
14
  opengl.concat %w[jogl-all.jar gluegen-rt.jar]
15
15
  opengl.each do |gl|
data/docs/.gitignore CHANGED
@@ -3,4 +3,5 @@
3
3
  _site
4
4
  .sass-cache
5
5
  .jekyll-metadata
6
+ .jekyll-cache
6
7
  Gemfile.lock
@@ -1,17 +1,17 @@
1
1
  ---
2
2
  layout: post
3
- title: "AppRender and ShapeRender"
4
- keywords: to_vertex, Vec3D, Vec2D, AppRender, ShapeRender
3
+ title: "GfxRender and ShapeRender"
4
+ keywords: to_vertex, Vec3D, Vec2D, GfxRender, ShapeRender
5
5
  ---
6
- Vec2D and Vec3D classes can be efficiently rendered as both PApplet vertices, and PShape vertices using AppRender and ShapeRender utility classes. To use the AppRender renderer you should create a single instance in the processing setup see below example:-
6
+ Vec2D and Vec3D classes can be efficiently rendered as both PApplet vertices, and PShape vertices using GfxRender and ShapeRender utility classes. To use the GfxRender renderer you should create a single instance in the processing setup see below example:-
7
7
 
8
- ### AppRender
8
+ ### GfxRender
9
9
 
10
10
  ```ruby
11
11
  attr_reader :renderer
12
12
  ...
13
13
  def setup
14
- @renderer = AppRender.new(self)
14
+ @renderer = GfxRender.new(self)
15
15
  end
16
16
  ...
17
17
  ```
@@ -1,11 +1,12 @@
1
1
  ---
2
2
  layout: post
3
- title: "noise_mode"
3
+ title: "Noise Modes"
4
4
  ---
5
5
 
6
6
  ### Name ###
7
7
 
8
- `noise_mode` _NB: not currently available in vanilla processing_.
8
+ There are two noise modes available in PiCrate, both base on KdotJPG java noise.
9
+ The default noise uses the FastNoise module, the SmoothNoise module can be used using the module name as a prefix see example below.
9
10
 
10
11
  ### Examples ###
11
12
 
@@ -25,24 +26,12 @@ class TestNoise < Processing::App
25
26
  noise_scale = 0.01
26
27
  background(0)
27
28
  grid(width, height, 10, 10) do |x, y|
28
- arrow(x, y, noise(x * noise_scale, y * noise_scale, z * noise_scale) * TWO_PI * 2)
29
+ arrow(x, y, SmoothNoise.noise(x * noise_scale, y * noise_scale, z * noise_scale) * TWO_PI * 2)
30
+ # arrow(x, y, noise(x * noise_scale, y * noise_scale, z * noise_scale) * TWO_PI * 2)
29
31
  end
30
32
  @z += 1
31
33
  end
32
34
 
33
- def mouse_pressed
34
- mode = NoiseMode::OPEN_SMOOTH # Smooth classic OpenSimplex2
35
- noise_mode mode
36
- sketch_title mode.description
37
- end
38
-
39
- def mouse_released
40
- mode = NoiseMode::DEFAULT # Fast classic OpenSimplex2
41
- noise_mode(mode)
42
- sketch_title mode.description
43
- end
44
-
45
-
46
35
  def arrow(x, y, ang)
47
36
  push_matrix()
48
37
  translate(x, y)
@@ -68,15 +57,14 @@ TestNoise.new
68
57
  ### Description ###
69
58
 
70
59
  Currently supports four implementations of noise:-
71
- 1. DEFAULT # fast classic OpenSimplex2
72
- 2. OPEN_SMOOTH # smoother class OpenSimplex2F
73
- 3. FAST_TERRAIN # more suited to terrain
74
- 4. SMOOTH_TERRAIN # as above but smoother
60
+ 1. Default is classic OpenSimplex2
61
+ 2. SmoothNoise use smoother class OpenSimplex2F
62
+ 3. Use tnoise instead of noise for a noise mode more suited to terrain
75
63
 
76
64
  ### Syntax ###
77
65
 
78
66
  ```ruby
79
- noise_mode(mode) # default is NoiseMode::DEFAULT, a fast classic OpenSimplex2
67
+ SmoothNoise.noise(...) # no prefix for fast classic OpenSimplex2
80
68
  ```
81
69
 
82
70
  ### Related ###
@@ -14,7 +14,7 @@ Get the latest version from [http://jruby.org/download][download]
14
14
 
15
15
  ```bash
16
16
  cd /opt
17
- sudo tar xzvf /pathToDownload/jruby-bin-9.2.14.0.tar.gz
17
+ sudo tar xzvf /pathToDownload/jruby-bin-9.3.1.0.tar.gz
18
18
  ```
19
19
 
20
20
  Then use the excellent `update-alternatives` tool to provide symbolic links to `jruby`, `jgem`, `jirb` and `rake` especially if you haven't installed `mri` ruby.
@@ -31,16 +31,16 @@ You should prefer to install gems locally (no need for sudo). To do that it is c
31
31
  ```bash
32
32
  alias jpry="jruby -e \"require 'pry'; binding.pry\""
33
33
  # export JAVA_HOME="/opt/jdk1.8.0_151" # if using oracle java openjdk-8 is fine though
34
- export GEM_HOME="$HOME/.gem/ruby/2.5.0"
35
- export GEM_PATH="$HOME/tux/.gem/ruby/2.5.0"
34
+ export GEM_HOME="$HOME/.gem/ruby/2.6.0"
35
+ export GEM_PATH="$HOME/tux/.gem/ruby/2.6.0"
36
36
  export PATH="${PATH}:${GEM_PATH}/bin"
37
37
  ```
38
38
 
39
39
  ### Automated install using bash ###
40
40
 
41
- The [picrate2_install.sh][bash] script currently installs jruby-9.2.14.0 and picrate-2.2.0.
41
+ The [picrate2_install.sh][bash] script currently installs jruby-9.3.0.0 and picrate-2.5.0.
42
42
 
43
43
  If you know better please post on wiki
44
44
 
45
- [download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.14.0/jruby-dist-9.2.14.0-bin.tar.gz"
45
+ [download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.3.1.0/jruby-dist-9.3.1.0-bin.tar.gz"
46
46
  [bash]:https://gist.github.com/monkstone/6ae9840d7b7008c177b4a9f589d14ec6
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  layout: post
3
- title: "Getting Started Buster"
3
+ title: "Getting Started RaspbianOS"
4
4
  date: 2019-11-11 07:34:13
5
5
  categories: PiCrate update
6
6
  permalink: /getting_buster/
7
7
  ---
8
- Raspbian Buster usually comes with a pre-installed jdk11. Before installing JRuby it is worth setting the `JAVA_HOME` environmental variable (needed to supress reflection warnings).
8
+ RaspberryPI OS usually comes with a pre-installed jdk11. Before installing JRuby it might be worth setting the `JAVA_HOME` environmental variable (_to supress reflection warnings_).
9
9
 
10
10
  __Otherwise follow these instructions in order as needed:-__
11
11
 
@@ -5,19 +5,28 @@ date: 2020-05-11 07:34:13
5
5
  categories: PiCrate update
6
6
  permalink: /getting_manjaro/
7
7
  ---
8
- If Manjaro does not come with a pre-installed java, then the first step is to install a `jdk` the distro version (jdk14) should work.
8
+ If Manjaro does not come with a pre-installed java, then the first step is to install a `jdk` the distro version (jdk16) should work.
9
9
 
10
10
  ```bash
11
- sudo pacman -S jdk-openjdk # current distro version jdk14
11
+ sudo pacman -S jre-openjdk # current distro version jdk16
12
12
  ```
13
13
  You can also use pacman to install jruby
14
14
  ```bash
15
- sudo pacman -S jruby # current version jruby-9.2.14.0
15
+ sudo pacman -S jruby # current version jruby-9.3.0.0
16
16
  ```
17
17
  It is probably a good idea to create a local gem store (rather needing to use sudo to install gems)
18
+ ```bash
19
+ sudo pacman -S vim # all you need if your happy with vim
20
+ ```
21
+ Vim is not installed by default
22
+ ```bash
23
+ sudo pacman -S geany # if you prefer a GUI
24
+ ```
25
+ Geany is not installed by default
26
+
18
27
 
19
28
  ```bash
20
- mkdir -p ~/.gem/ruby/2.5.0 # current MRI version supported by jruby
29
+ mkdir -p ~/.gem/ruby/2.6.0 # current MRI version supported by jruby
21
30
  ```
22
31
  Now set your `GEM_HOME`, `GEM_PATH` and amend your `PATH` as follows:-
23
32
 
data/docs/about.md CHANGED
@@ -4,7 +4,7 @@ title: About
4
4
  permalink: /about/
5
5
  ---
6
6
  ![picrate.png]({{ site.github.url }}/assets/android-chrome-192x192.png)
7
- PiCrate is both a `library` and an `app` that allows you to create [processing][processing] sketches in ruby on the [RaspberryPI][PI] (or 64 bit linux). PiCrate is available as a gem (from [rubygems][rubygems]), it requires [JRuby][jruby] to both install and run. It does not depend on a vanilla processing install ( _cf_ JRubyArt).Tested on raspbian Buster on RaspberryPI3B+ and RaspberryPI4, also works on Manajaro distro (64bit) on RapsberryPI4.
7
+ PiCrate is both a `library` and an `app` that allows you to create [processing][processing] sketches in ruby on the [RaspberryPI][PI] (or 64 bit linux). PiCrate is available as a gem (from [rubygems][rubygems]), it requires [JRuby][jruby] to both install and run. It does not depend on a vanilla processing install.Tested on RaspbianOS on RaspberryPI3B+ and RaspberryPI4, also works on Manajaro distro (64bit) on RaspberryPI4.
8
8
 
9
9
  #### Executable ####
10
10
 
data/lib/picrate/app.rb CHANGED
@@ -84,7 +84,7 @@ module Processing
84
84
  class << self
85
85
  # Handy getters and setters on the class go here:
86
86
  attr_accessor :sketch_class, :library_loader, :arguments, :options
87
- attr_reader :surface
87
+ attr_reader :surface, :width, :height, :mode
88
88
  def load_libraries(*args)
89
89
  library_loader ||= LibraryLoader.new
90
90
  library_loader.load_library(*args)
@@ -135,7 +135,7 @@ module Processing
135
135
  w, h, mode = *args
136
136
  @width ||= w
137
137
  @height ||= h
138
- @render_mode ||= mode
138
+ @mode ||= mode
139
139
  import_opengl if /opengl/ =~ mode
140
140
  super(*args)
141
141
  end
@@ -159,12 +159,6 @@ module Processing
159
159
  end
160
160
  end
161
161
 
162
- def proxy_java_fields
163
- fields = %w[sketchPath key frameRate mousePressed keyPressed]
164
- methods = fields.map { |field| java_class.declared_field(field) }
165
- @declared_fields = Hash[fields.zip(methods)]
166
- end
167
-
168
162
  # When certain special methods get added to the sketch, we need to let
169
163
  # Processing call them by their expected Java names.
170
164
  def method_added(method_name) #:nodoc:
@@ -117,14 +117,14 @@ module Processing
117
117
  # some methods. Add to this list as needed.
118
118
  def proxy_java_fields
119
119
  fields = %w[key frameRate mousePressed keyPressed]
120
- methods = fields.map { |field| java_class.declared_field(field) }
121
- @declared_fields = Hash[fields.zip(methods)]
120
+ methods = fields.map { |field| java_class.field(field) }
121
+ @jfields = Hash[fields.zip(methods)]
122
122
  end
123
123
 
124
124
  # Fix java conversion problems getting the last key
125
125
  # If it's ASCII, return the character, otherwise the integer
126
126
  def key
127
- int = @declared_fields['key'].value(java_self)
127
+ int = @jfields['key'].value(java_self)
128
128
  int < 256 ? int.chr : int
129
129
  end
130
130
 
@@ -161,19 +161,19 @@ module Processing
161
161
 
162
162
  # frame_rate needs to support reading and writing
163
163
  def frame_rate(fps = nil)
164
- return @declared_fields['frameRate'].value(java_self) unless fps
164
+ return @jfields['frameRate'].value(java_self) unless fps
165
165
 
166
166
  super(fps)
167
167
  end
168
168
 
169
169
  # Is the mouse pressed for this frame?
170
170
  def mouse_pressed?
171
- @declared_fields['mousePressed'].value(java_self)
171
+ @jfields['mousePressed'].value(java_self)
172
172
  end
173
173
 
174
174
  # Is a key pressed for this frame?
175
175
  def key_pressed?
176
- @declared_fields['keyPressed'].value(java_self)
176
+ @jfields['keyPressed'].value(java_self)
177
177
  end
178
178
 
179
179
  private
@@ -8,7 +8,7 @@ class NativeFolder
8
8
  ARM64 = '-aarch64'.freeze
9
9
 
10
10
  def initialize
11
- @os = java.lang.System.get_property('os.name')
11
+ @os = java.lang.System.get_property('os.name').downcase
12
12
  @bit = java.lang.System.get_property('os.arch')
13
13
  end
14
14
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PiCrate
4
- VERSION = '2.4.0'
4
+ VERSION = '2.5.1'
5
5
  end
data/picrate.gemspec CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |gem|
33
33
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
34
34
  gem.add_development_dependency 'minitest', '~> 5.14'
35
35
  gem.add_runtime_dependency 'rake', '~> 13.0'
36
- gem.add_runtime_dependency 'arcball', '~> 1.0', '>= 1.0.1'
36
+ gem.add_runtime_dependency 'arcball', '~> 1.2'
37
37
  gem.require_paths = ['lib']
38
38
  gem.platform = 'java'
39
39
  gem.requirements << 'java runtime == 11+'
data/pom.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  project 'picrate', 'http://maven.apache.org' do
4
4
  model_version '4.0.0'
5
- id 'ruby-processing:picrate:2.4.0'
5
+ id 'ruby-processing:picrate:2.5.1'
6
6
  packaging 'jar'
7
7
 
8
8
  description 'An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.'
@@ -24,6 +24,7 @@ project 'picrate', 'http://maven.apache.org' do
24
24
  issue_management 'https://github.com/ruby-processing/PiCrate/issues', 'Github'
25
25
  # Need to update to jogl 2.4.1 as soon as available, then make a dependency
26
26
  properties('jogl.version' => '2.3.2',
27
+ 'jruby.version' => '9.3.1.0',
27
28
  'batik.version' => '1.14',
28
29
  'itextpdf.version' => '5.5.13.2',
29
30
  'jruby.api' => 'http://jruby.org/apidocs/',
@@ -33,7 +34,7 @@ project 'picrate', 'http://maven.apache.org' do
33
34
  'project.build.sourceEncoding' => 'UTF-8',
34
35
  'polyglot.dump.pom' => 'pom.xml')
35
36
 
36
- pom 'org.jruby:jruby:9.2.16.0'
37
+ jar 'org.jruby:jruby-base:${jruby.version}'
37
38
  jar 'org.jogamp.jogl:jogl-all:${jogl.version}'
38
39
  jar 'org.jogamp.gluegen:gluegen-rt-main:${jogl.version}'
39
40
  jar 'org.processing:video:3.0.2'
@@ -82,11 +83,10 @@ end
82
83
  build do
83
84
  resource do
84
85
  directory '${source.directory}/main/java'
85
- includes '**/**/*.glsl', '**/*.jnilib'
86
86
  excludes '**/**/*.java'
87
87
  end
88
88
  resource do
89
89
  directory '${source.directory}/main/resources'
90
- includes '**/*.png', '*.txt'
90
+ includes '**/*.png', '**/*.txt', '**/*.glsl'
91
91
  end
92
92
  end
data/pom.xml CHANGED
@@ -11,7 +11,7 @@ DO NOT MODIFY - GENERATED CODE
11
11
  <modelVersion>4.0.0</modelVersion>
12
12
  <groupId>ruby-processing</groupId>
13
13
  <artifactId>picrate</artifactId>
14
- <version>2.4.0</version>
14
+ <version>2.5.1</version>
15
15
  <name>picrate</name>
16
16
  <description>An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.</description>
17
17
  <url>http://maven.apache.org</url>
@@ -68,6 +68,7 @@ DO NOT MODIFY - GENERATED CODE
68
68
  <itextpdf.version>5.5.13.2</itextpdf.version>
69
69
  <jogl.version>2.3.2</jogl.version>
70
70
  <jruby.api>http://jruby.org/apidocs/</jruby.api>
71
+ <jruby.version>9.3.1.0</jruby.version>
71
72
  <picrate.basedir>${project.basedir}</picrate.basedir>
72
73
  <polyglot.dump.pom>pom.xml</polyglot.dump.pom>
73
74
  <processing.api>http://processing.github.io/processing-javadocs/core/</processing.api>
@@ -77,9 +78,8 @@ DO NOT MODIFY - GENERATED CODE
77
78
  <dependencies>
78
79
  <dependency>
79
80
  <groupId>org.jruby</groupId>
80
- <artifactId>jruby</artifactId>
81
- <version>9.2.16.0</version>
82
- <type>pom</type>
81
+ <artifactId>jruby-base</artifactId>
82
+ <version>${jruby.version}</version>
83
83
  </dependency>
84
84
  <dependency>
85
85
  <groupId>org.jogamp.jogl</groupId>
@@ -111,10 +111,6 @@ DO NOT MODIFY - GENERATED CODE
111
111
  <resources>
112
112
  <resource>
113
113
  <directory>${source.directory}/main/java</directory>
114
- <includes>
115
- <include>**/**/*.glsl</include>
116
- <include>**/*.jnilib</include>
117
- </includes>
118
114
  <excludes>
119
115
  <exclude>**/**/*.java</exclude>
120
116
  </excludes>
@@ -123,7 +119,8 @@ DO NOT MODIFY - GENERATED CODE
123
119
  <directory>${source.directory}/main/resources</directory>
124
120
  <includes>
125
121
  <include>**/*.png</include>
126
- <include>*.txt</include>
122
+ <include>**/*.txt</include>
123
+ <include>**/*.glsl</include>
127
124
  </includes>
128
125
  </resource>
129
126
  </resources>
@@ -49,21 +49,21 @@ public class FastNoiseModuleJava {
49
49
  double four;
50
50
  switch (args.length) {
51
51
  case 2:
52
- two = (args[1] instanceof RubyFloat) ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
53
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
52
+ two = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
53
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
54
54
  result = ng.noise2_XBeforeY(one, two);
55
55
  break;
56
56
  case 3:
57
- three = (args[2] instanceof RubyFloat) ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
58
- two = (args[1] instanceof RubyFloat) ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
59
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
57
+ three = args[2] instanceof RubyFloat ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
58
+ two = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
59
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
60
60
  result = ng.noise3_XYBeforeZ(one, two, three);
61
61
  break;
62
62
  case 4:
63
- four = (args[3] instanceof RubyFloat) ? ((RubyFloat) args[3]).getValue() : ((RubyFixnum) args[3]).getDoubleValue();
64
- three = (args[2] instanceof RubyFloat) ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
65
- two = (args[1] instanceof RubyFloat) ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
66
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
63
+ four = args[3] instanceof RubyFloat ? ((RubyFloat) args[3]).getValue() : ((RubyFixnum) args[3]).getDoubleValue();
64
+ three = args[2] instanceof RubyFloat ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
65
+ two = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
66
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
67
67
  result = ng.noise4_XYBeforeZW(one, two, three, four);
68
68
  break;
69
69
  default:
@@ -88,25 +88,25 @@ public class FastNoiseModuleJava {
88
88
  double four;
89
89
  switch (args.length) {
90
90
  case 1:
91
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
91
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
92
92
  result = ng.noise2(one, 0);
93
93
  break;
94
94
  case 2:
95
- two = (args[1] instanceof RubyFloat) ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
96
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
95
+ two = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
96
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
97
97
  result = ng.noise2(one, two);
98
98
  break;
99
99
  case 3:
100
- three = (args[2] instanceof RubyFloat) ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
101
- two = (args[1] instanceof RubyFloat) ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
102
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
100
+ three = args[2] instanceof RubyFloat ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
101
+ two = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
102
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
103
103
  result = ng.noise3_Classic(one, two, three);
104
104
  break;
105
105
  case 4:
106
- four = (args[3] instanceof RubyFloat) ? ((RubyFloat) args[3]).getValue() : ((RubyFixnum) args[3]).getDoubleValue();
107
- three = (args[2] instanceof RubyFloat) ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
108
- two = (args[1] instanceof RubyFloat) ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
109
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
106
+ four = args[3] instanceof RubyFloat ? ((RubyFloat) args[3]).getValue() : ((RubyFixnum) args[3]).getDoubleValue();
107
+ three = args[2] instanceof RubyFloat ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
108
+ two = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
109
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
110
110
  result = ng.noise4_Classic(one, two, three, four);
111
111
  break;
112
112
  default:
@@ -49,21 +49,21 @@ public class SmoothNoiseModuleJava {
49
49
  double four;
50
50
  switch (args.length) {
51
51
  case 2:
52
- two = (args[1] instanceof RubyFloat) ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
53
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
52
+ two = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
53
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
54
54
  result = ng.noise2_XBeforeY(one, two);
55
55
  break;
56
56
  case 3:
57
- three = (args[2] instanceof RubyFloat) ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
58
- two = (args[1] instanceof RubyFloat) ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
59
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
57
+ three = args[2] instanceof RubyFloat ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
58
+ two = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
59
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
60
60
  result = ng.noise3_XYBeforeZ(one, two, three);
61
61
  break;
62
62
  case 4:
63
- four = (args[3] instanceof RubyFloat) ? ((RubyFloat) args[3]).getValue() : ((RubyFixnum) args[3]).getDoubleValue();
64
- three = (args[2] instanceof RubyFloat) ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
65
- two = (args[1] instanceof RubyFloat) ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
66
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
63
+ four = args[3] instanceof RubyFloat ? ((RubyFloat) args[3]).getValue() : ((RubyFixnum) args[3]).getDoubleValue();
64
+ three = args[2] instanceof RubyFloat ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
65
+ two = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
66
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
67
67
  result = ng.noise4_XYBeforeZW(one, two, three, four);
68
68
  break;
69
69
  default:
@@ -88,25 +88,25 @@ public class SmoothNoiseModuleJava {
88
88
  double four;
89
89
  switch (args.length) {
90
90
  case 1:
91
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
91
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
92
92
  result = ng.noise2(one, 0);
93
93
  break;
94
94
  case 2:
95
- two = (args[1] instanceof RubyFloat) ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
96
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
95
+ two = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
96
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
97
97
  result = ng.noise2(one, two);
98
98
  break;
99
99
  case 3:
100
- three = (args[2] instanceof RubyFloat) ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
101
- two = (args[1] instanceof RubyFloat) ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
102
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
100
+ three = args[2] instanceof RubyFloat ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
101
+ two = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
102
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
103
103
  result = ng.noise3_Classic(one, two, three);
104
104
  break;
105
105
  case 4:
106
- four = (args[3] instanceof RubyFloat) ? ((RubyFloat) args[3]).getValue() : ((RubyFixnum) args[3]).getDoubleValue();
107
- three = (args[2] instanceof RubyFloat) ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
108
- two = (args[1] instanceof RubyFloat) ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
109
- one = (args[0] instanceof RubyFloat) ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
106
+ four = args[3] instanceof RubyFloat ? ((RubyFloat) args[3]).getValue() : ((RubyFixnum) args[3]).getDoubleValue();
107
+ three = args[2] instanceof RubyFloat ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
108
+ two = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
109
+ one = args[0] instanceof RubyFloat ? ((RubyFloat) args[0]).getValue() : ((RubyFixnum) args[0]).getDoubleValue();
110
110
  result = ng.noise4_Classic(one, two, three, four);
111
111
  break;
112
112
  default: