processing 0.5.6 → 0.5.8

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: '09125754200830d8b1e3cc8fce0f31194bbe0c319ffd0410be43a3860ef5747e'
4
- data.tar.gz: 5cf8e0e1c1c0b1fc46d88c6043ad3a44e32819dd7a9ace3066489c101529b40e
3
+ metadata.gz: ed81c4d96658275007c873b5f32fc445982fe79b80a2bc082bedff56e6008de4
4
+ data.tar.gz: 51c826f5baa2d107a8020e4aa7631ce4a5f636c43f90dd52a7a0227afc3b3ed8
5
5
  SHA512:
6
- metadata.gz: 60829858cded743eb30a1bd7076953048f824a159d6fd98d8c8e08ec49f80802e0ca2554f04a0766ad6a4067db75f4938a1aae1d7c51b55bb0ad4e2e7cd7c622
7
- data.tar.gz: aa3f8da5dd0168cca1aef67462dc11930f5a1dec95b52dab31e720df114f40ead20ff5062a898baca80eb87f76e6a13731d8dd22ff932e86c44cf28426ddacd8
6
+ metadata.gz: 6ad89a983085617ddf327ee16949165e93c8b7262bc7ca00d1353b855fa96f9603045933ab6dc9de36f86dade87e03c204ebd02cd25d1f855bdc360b7f86b113
7
+ data.tar.gz: 962c4288dba17ce1296d5a6b3bc36bf43854fb5091367f4cb3dd379a69f2a8201fe18e0cbb267942599dde7c5582e9c12740348e91cfddacfddbc2ddd7430a22
data/ChangeLog.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # processing ChangeLog
2
2
 
3
3
 
4
+ ## [v0.5.8] - 2023-05-13
5
+
6
+ - Update dependencies
7
+
8
+
9
+ ## [v0.5.7] - 2023-05-11
10
+
11
+ - Add examples/shake.rb
12
+ - Fix Vector.random2D() not working correctly when angleMode is set to DEGREES
13
+
14
+
4
15
  ## [v0.5.6] - 2023-05-08
5
16
 
6
17
  - Add inspect() to classes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.6
1
+ 0.5.8
data/examples/shake.rb ADDED
@@ -0,0 +1,24 @@
1
+ %w[xot rays reflex processing]
2
+ .map {|s| File.expand_path "../../#{s}/lib", __dir__}
3
+ .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
4
+
5
+ require 'processing'
6
+ using Processing
7
+
8
+ shake = 0
9
+
10
+ draw do
11
+ background 100
12
+
13
+ v = Vector.random2D * shake
14
+ translate v.x, v.y
15
+ shake *= 0.8
16
+
17
+ textSize 50
18
+ text 'hello, world!', 30, 50
19
+ rect 100, 100, 200, 100
20
+ end
21
+
22
+ mouseClicked do
23
+ shake = 10
24
+ end
@@ -513,7 +513,8 @@ module Processing
513
513
  # @return [Vector] a random vector
514
514
  #
515
515
  def self.random2D(target = nil)
516
- v = self.fromAngle rand 0.0...(Math::PI * 2)
516
+ v = self.new(1, 0, 0)
517
+ v.getInternal__.rotate! rand 0.0...360.0
517
518
  target.set v if target
518
519
  v
519
520
  end
@@ -545,7 +546,7 @@ module Processing
545
546
 
546
547
  # @private
547
548
  def <=>(o)
548
- @point <=> o.getInternal__
549
+ @point <=> o&.getInternal__
549
550
  end
550
551
 
551
552
  # @private
data/processing.gemspec CHANGED
@@ -30,8 +30,8 @@ Gem::Specification.new do |s|
30
30
 
31
31
  s.add_runtime_dependency 'xot', '~> 0.1.35'
32
32
  s.add_runtime_dependency 'rucy', '~> 0.1.35'
33
- s.add_runtime_dependency 'rays', '~> 0.1.35'
34
- s.add_runtime_dependency 'reflexion', '~> 0.1.36'
33
+ s.add_runtime_dependency 'rays', '~> 0.1.36'
34
+ s.add_runtime_dependency 'reflexion', '~> 0.1.38'
35
35
 
36
36
  s.add_development_dependency 'rake'
37
37
  s.add_development_dependency 'test-unit'
data/test/test_vector.rb CHANGED
@@ -338,6 +338,25 @@ class TestVector < Test::Unit::TestCase
338
338
  assert_equal_vector vec(M.cos(angle * 2), M.sin(angle * 2), 0), v.rotate(angle)
339
339
  end
340
340
 
341
+ def test_compare()
342
+ v = vec 1, 2, 3
343
+ assert v == vec(1, 2, 3)
344
+ assert_not v != vec(1, 2, 3)
345
+
346
+ assert v < vec(2, 2, 3)
347
+ assert v < vec(1, 3, 3)
348
+ assert v < vec(1, 2, 4)
349
+
350
+ assert v > vec(0, 2, 3)
351
+ assert v > vec(1, 1, 3)
352
+ assert v > vec(1, 2, 2)
353
+
354
+ assert_not v == nil
355
+ assert v != nil
356
+ assert_raise {v < nil}
357
+ assert_raise {v > nil}
358
+ end
359
+
341
360
  def test_fromAngle()
342
361
  angle = PI * 2 * 0.1
343
362
  result = vec
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: processing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-08 00:00:00.000000000 Z
11
+ date: 2023-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.35
47
+ version: 0.1.36
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.35
54
+ version: 0.1.36
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: reflexion
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.1.36
61
+ version: 0.1.38
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.1.36
68
+ version: 0.1.38
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -132,6 +132,7 @@ files:
132
132
  - examples/delay_camera.rb
133
133
  - examples/hello.rb
134
134
  - examples/image.rb
135
+ - examples/shake.rb
135
136
  - examples/shapes.rb
136
137
  - lib/processing.rb
137
138
  - lib/processing/all.rb