picrate 2.5.1-java → 2.5.2-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3f8a1c6f427e8d6496ffa52f10da57bc8763f8dd92d52074652409658684fba
4
- data.tar.gz: b0e3cf6d3c457bea3fdda0642d10c0a443528752b13e1ac2dd767f2bb3c0798a
3
+ metadata.gz: b4a2f73c549d8ee796280cc60c5f304c50adc474375e56a7f1c27517f4e04f90
4
+ data.tar.gz: f326bd382abcdf8bb8b6ae76124ccddbfff932a4aac2f0c22c176928575bdbeb
5
5
  SHA512:
6
- metadata.gz: 1de09c1115c514a845a63b00d777784550c2d1a1c20662ed59974727460652927ab7706d7380433cea31fd1f7d67c7b31f494bd566b990c9e94152120766b543
7
- data.tar.gz: 290f982b1b70b41e58de89182b2603f96c6276f1381d19f10b5d3827aebea20f81af3c609cb07fda2a662a21b02dae5ce72dbd18b9adda12970bf0eca87865c8
6
+ metadata.gz: '088cbf53dfa5f0b149d5312a7c5a2e52d81cebb54f05370feb813fb9aaa59bfc56dc6659dc0090c6b6451fb730a269e1e536e88c7cd2ce22a25c263a547ebf17'
7
+ data.tar.gz: 82ad21a6e136b0206018dc8b8906884303e1daf36995568e774a8ce5a4894733df1d5c0486b4ad4c910cb4c29df938c613cdf621d85ae4c5af87d0d0cb31e605
data/CHANGELOG.md CHANGED
@@ -1,4 +1,6 @@
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.
1
+ v2.5.2 Update to JRuby-9.3.2.0.
2
+
3
+ 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.2.0.
2
4
 
3
5
  v2.5.0 Update to JRuby-9.3.0.0.
4
6
 
data/README.md CHANGED
@@ -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.5.1-java.gem
22
+ jgem install picrate-2.5.2-java.gem
23
23
 
24
24
  ```
25
25
  To create a template sketch:-
@@ -4,7 +4,7 @@ title: "Vec2D"
4
4
  permalink: /classes/vec2d/
5
5
  ---
6
6
 
7
- The Vec2D class is a direct replacement for processings PVector class (when used for 2D work, see Vec3D for 3D version).
7
+ The Vec2D class is a direct replacement for processings PVector class (when used for 2D work, see Vec3D for 3D version). Recently cross product is deprecated in favor of the more correct wedge `^` product
8
8
 
9
9
  ### Methods:-
10
10
  ```ruby
@@ -15,7 +15,7 @@ a / b # where a is instance of Vec2D and b is a scalar
15
15
  a == b # where both a and b are both instances of Vec2D
16
16
  a.angle_between(b) # where both a and b are both instances of Vec2D
17
17
  a.copy # where a is instance of Vec2D returns a deep copy
18
- a.cross(b) # where both a and b are both instances of Vec2D
18
+ a ^ b # wedge product where both a and b are both instances of Vec2D
19
19
  a.dist(b) # where both a and b are both instances of Vec2D
20
20
  a.dot(b) # where both a and b are both instances of Vec2D
21
21
  a.heading # where a is instance of Vec2D
@@ -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.3.1.0.tar.gz
17
+ sudo tar xzvf /pathToDownload/jruby-bin-9.3.2.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.
@@ -42,5 +42,5 @@ The [picrate2_install.sh][bash] script currently installs jruby-9.3.0.0 and picr
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.3.1.0/jruby-dist-9.3.1.0-bin.tar.gz"
45
+ [download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.3.2.0/jruby-dist-9.3.2.0-bin.tar.gz"
46
46
  [bash]:https://gist.github.com/monkstone/6ae9840d7b7008c177b4a9f589d14ec6
@@ -8,7 +8,7 @@ permalink: /getting_manjaro/
8
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 jre-openjdk # current distro version jdk16
11
+ sudo pacman -S jre-openjdk # current distro version jdk17
12
12
  ```
13
13
  You can also use pacman to install jruby
14
14
  ```bash
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PiCrate
4
- VERSION = '2.5.1'
4
+ VERSION = '2.5.2'
5
5
  end
Binary file
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.5.1'
5
+ id 'ruby-processing:picrate:2.5.2'
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,7 +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
+ 'jruby.version' => '9.3.2.0',
28
28
  'batik.version' => '1.14',
29
29
  'itextpdf.version' => '5.5.13.2',
30
30
  'jruby.api' => 'http://jruby.org/apidocs/',
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.5.1</version>
14
+ <version>2.5.2</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,7 +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
+ <jruby.version>9.3.2.0</jruby.version>
72
72
  <picrate.basedir>${project.basedir}</picrate.basedir>
73
73
  <polyglot.dump.pom>pom.xml</polyglot.dump.pom>
74
74
  <processing.api>http://processing.github.io/processing-javadocs/core/</processing.api>
@@ -21,6 +21,7 @@ package monkstone.vecmath.vec2;
21
21
  *
22
22
  * fastAtan2 algorithm from https://github.com/libgdx/libgdx (Apache 2.0 license)
23
23
  */
24
+ import java.util.logging.Logger;
24
25
  import org.jruby.Ruby;
25
26
  import org.jruby.RubyArray;
26
27
  import org.jruby.RubyClass;
@@ -228,19 +229,27 @@ public final class Vec2 extends RubyObject {
228
229
  return runtime.newFloat(result);
229
230
  }
230
231
 
232
+ @Deprecated
233
+ @JRubyMethod(name = "cross", required = 1)
234
+ public IRubyObject cross(ThreadContext context, IRubyObject other) {
235
+ Logger log = Logger.getGlobal();
236
+ log.warning("prefer ^ operator");
237
+ return op_wedge(context, other);
238
+ }
239
+
231
240
  /**
232
241
  *
233
242
  * @param context ThreadContext
234
243
  * @param other IRubyObject
235
- * @return cross product IRubyObject
244
+ * @return wedge product IRubyObject
236
245
  */
237
- @JRubyMethod(name = "cross", required = 1)
246
+ @JRubyMethod(name = "^", required = 1)
238
247
 
239
- public IRubyObject cross(ThreadContext context, IRubyObject other) {
248
+ public IRubyObject op_wedge(ThreadContext context, IRubyObject other) {
240
249
  Vec2 b = null;
241
250
  Ruby runtime = context.runtime;
242
251
  if (other instanceof Vec2) {
243
- b = (Vec2) other.toJava(Vec2.class);
252
+ b = other.toJava(Vec2.class);
244
253
  } else {
245
254
  throw runtime.newTypeError("argument should be Vec2D");
246
255
  }
@@ -401,7 +410,7 @@ public final class Vec2 extends RubyObject {
401
410
  public IRubyObject set_mag(ThreadContext context, IRubyObject scalar, Block block) {
402
411
  double new_mag = scalar.toJava(Double.class);
403
412
  if (block.isGiven() && !block.yield(context, scalar).toJava(Boolean.class)) {
404
- return this;
413
+ return this;
405
414
  }
406
415
  double current = 0;
407
416
  if (Math.abs(jx) > EPSILON && Math.abs(jy) > EPSILON) {
@@ -789,7 +798,7 @@ public final class Vec2 extends RubyObject {
789
798
  double diff = jx - v.jx;
790
799
  if ((diff < 0 ? -diff : diff) > Vec2.EPSILON) {
791
800
  return runtime.newBoolean(false);
792
- }
801
+ }
793
802
  diff = jy - v.jy;
794
803
  return runtime.newBoolean((diff < 0 ? -diff : diff) < Vec2.EPSILON);
795
804
  }
@@ -270,14 +270,14 @@ class VecmathTest < Minitest::Test
270
270
  a = Vec2D.new(200, 0)
271
271
  b = Vec2D.new(0, 200)
272
272
  # Expected result is an area, twice that of the triangle created by the vectors
273
- assert_equal(a.cross(b).abs, 40_000.0, 'Failed area test using 2D vector cross product')
273
+ assert_equal((a ^ b).abs, 40_000.0, 'Failed area test using 2D vector cross product')
274
274
  end
275
275
 
276
276
  def test_cross_non_zero # Could be used to calculate area of triangle
277
277
  a = Vec2D.new(40, 40)
278
278
  b = Vec2D.new(40, 140)
279
279
  c = Vec2D.new(140, 40)
280
- assert_equal((a - b).cross(b - c).abs / 2, 5_000.0, 'Failed area calculation using 2D vector cross product')
280
+ assert_equal(((a - b) ^ (b - c)).abs / 2, 5_000.0, 'Failed area calculation using 2D vector cross product')
281
281
  end
282
282
 
283
283
  def test_cross_zero # where a, b, c are collinear area == 0
@@ -285,7 +285,7 @@ class VecmathTest < Minitest::Test
285
285
  b = Vec2D.new(100, 100)
286
286
  c = Vec2D.new(200, 200)
287
287
  # see http://mathworld.wolfram.com/Collinear.html for details
288
- assert((a - b).cross(b - c).zero?, 'Failed collinearity test using 2D vector cross product')
288
+ assert(((a - b) ^ (b - c)).zero?, 'Failed collinearity test using 2D vector cross product')
289
289
  end
290
290
 
291
291
  def test_equals3
data/vendors/Rakefile CHANGED
@@ -8,7 +8,7 @@ SOUND = 'sound.zip'
8
8
  PROCESSING_GITHUB = 'https://github.com/processing'
9
9
  VIDEO = 'video.zip'
10
10
  DOWNLOAD = 'releases/download/latest'
11
- EXAMPLES = '0.5.8'
11
+ EXAMPLES = '0.5.9'
12
12
  HOME_DIR = ENV['HOME']
13
13
  LIBRARY = File.join(HOME_DIR, '.picrate', 'libraries')
14
14
  PROJECT_DIR = File.join(HOME_DIR, 'projects')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.2
5
5
  platform: java
6
6
  authors:
7
7
  - monkstone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-16 00:00:00.000000000 Z
11
+ date: 2021-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -185,7 +185,7 @@ files:
185
185
  - lib/jogl-all-natives-linux-amd64.jar
186
186
  - lib/jogl-all-natives-linux-armv6hf.jar
187
187
  - lib/jogl-all.jar
188
- - lib/picrate-2.5.1.jar
188
+ - lib/picrate-2.5.2.jar
189
189
  - lib/picrate.rb
190
190
  - lib/picrate/app.rb
191
191
  - lib/picrate/creators/parameters.rb
Binary file