soby 0.0.4 → 0.0.5

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/soby/slide.rb +4 -4
  3. data/lib/soby.rb +3 -3
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a80e59efa073e8a79cff764a986e4f60388e047
4
- data.tar.gz: 956b447e612e40f24e47a045e4364cb4d9aaabce
3
+ metadata.gz: 0883ade6bccddac1f2a8c7bfcaebf37d00a404f4
4
+ data.tar.gz: fd3ce476ec13bd111b266ab45b6a150a5b40197e
5
5
  SHA512:
6
- metadata.gz: 96aa53ec38fa0b1e9b2fd2906416273c93d88232a9ec91df90710b718b0e7e87a592624bc1549baf30be901f1c25b4bf76a141a47c499d3ce9b655ae8f28720d
7
- data.tar.gz: 905367b0c8854409ec4cc84a33b70d6537fa70c7b6de0e9ae04590898afef71bb2a13a862b6a3524d09aaa6728eb4b6ce2ab6a968d3a1f4f1e5e5ac854b19b4b
6
+ metadata.gz: 0ec5a87091c099e6b4c19309bf670d400967b569ae6fa4d422c3a4580fb8dc6bb65ddc7cdb747d552a099470b3e2245577e08f97ad38fb9271a54e1283d77526
7
+ data.tar.gz: b7d7a652478ce39e721336f54e7a0ee3cbfa746f680014739856091480857c5c02d6cfb8ffbf4f20eaf6907586aa6f6241050d4f403fecd71bd532f9fb400e1f
data/lib/soby/slide.rb CHANGED
@@ -52,19 +52,19 @@ class Slide
52
52
  when "strong-accelerate"
53
53
  @transition = Proc.new { |x| x**5 }
54
54
  when "decelerate"
55
- @transition = Proc.new { |x| 1 - Math.pow(1 - x, 3) }
55
+ @transition = Proc.new { |x| 1 - ((1 - x) ** 3) }
56
56
  when "strong-decelerate"
57
- @transition = Proc.new { |x| 1 - Math.pow(1 - x, 5) }
57
+ @transition = Proc.new { |x| 1 - ((1 - x) ** 5) }
58
58
  when "accelerate-decelerate"
59
59
  @transition = Proc.new { |x|
60
60
  xs = x <= 0.5 ? x : 1 - x
61
- y = Math.pow(2 * xs, 3) / 2
61
+ y = ((2 * xs) ** 3) / 2
62
62
  x <= 0.5 ? y : 1 - y
63
63
  }
64
64
  when "strong-decelerate-accelerate"
65
65
  @transition = Proc.new { |x|
66
66
  xs = x <= 0.5 ? x : 1 - x
67
- y = Math.pow(2 * xs, 5) / 2
67
+ y = ((2 * xs) ** 5) / 2
68
68
  x <= 0.5 ? y : 1 - y
69
69
  }
70
70
  when "immediate-beginning"
data/lib/soby.rb CHANGED
@@ -321,11 +321,11 @@ class SobyPlayer < Processing::App
321
321
  return if @slides.size == 0
322
322
 
323
323
  elapsed_time = millis - @transition_start_time
324
- @current_ratio = elapsed_time.to_f / @transition_duration.to_f
324
+ @current_time_ratio = elapsed_time.to_f / @transition_duration.to_f
325
325
 
326
- @current_ratio = @slides[@current_slide_no].transition @current_ratio unless @current_slide_no == 0
326
+ @current_ratio = @slides[@current_slide_no].transition @current_time_ratio unless @current_slide_no == 0
327
327
 
328
- if @current_ratio > 1 && @is_moving
328
+ if (@current_ratio > 1 || @current_time_ratio > 1) && @is_moving
329
329
  @is_moving = false
330
330
  @cam = @prev_cam.lerp(@next_cam, 1)
331
331
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Laviole
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-19 00:00:00.000000000 Z
11
+ date: 2015-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement