physicist 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/lib/physicist.rb +0 -3
- data/lib/physicist/body.rb +2 -8
- data/lib/physicist/laboratory/app.rb +3 -0
- data/lib/physicist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 790c22f595f4cf317124703c8ce30bc0e64b6746
|
4
|
+
data.tar.gz: 57a74e633a43c0cb4cf94c2a10fc598cd282cb39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abaf403f5be9dc22550fa8e4d33f31babbef6e26a3282980ca1068298c15c48b745aeed738512bdf976986da3cd0b6cda03102cb48d5d4eecde2c5415b8d7cc4
|
7
|
+
data.tar.gz: 6b90301347b6978a7dd9bbc4bd0c5e26dc5ba2696fdcfc027370cd0d8be29eef03eddfe18dd78f64a4e8b7e873d875426d77b1cb4d17493df0fdabba0f609607
|
data/lib/physicist.rb
CHANGED
data/lib/physicist/body.rb
CHANGED
@@ -138,9 +138,7 @@ module Physicist
|
|
138
138
|
def next_obstacle_on_x_axis(y,vx,t,obstacles:)
|
139
139
|
x0,_ = *position
|
140
140
|
|
141
|
-
|
142
|
-
# x0 += w/2.0
|
143
|
-
w = width/2.0
|
141
|
+
w = (width/2.0)
|
144
142
|
x0 += w/2.0
|
145
143
|
|
146
144
|
obstacles_along_axis = obstacles.select do |obstacle|
|
@@ -154,18 +152,14 @@ module Physicist
|
|
154
152
|
if vx > 0
|
155
153
|
obstacles_along_axis.select do |obstacle|
|
156
154
|
ox,_ = *obstacle.position
|
157
|
-
# ow,oh = *obstacle.dimensions
|
158
155
|
|
159
|
-
ox >= x0 + w
|
156
|
+
ox >= x0 + w
|
160
157
|
end
|
161
158
|
elsif vx < 0
|
162
|
-
# require 'pry'
|
163
|
-
# binding.pry
|
164
159
|
obstacles_along_axis.select do |obstacle|
|
165
160
|
ox,_ = *obstacle.position
|
166
161
|
ow,_ = *obstacle.dimensions
|
167
162
|
x0 >= ox + ow
|
168
|
-
# ox + ow >= x0
|
169
163
|
end
|
170
164
|
else
|
171
165
|
[]
|
data/lib/physicist/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: physicist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Weissman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|