jruby_art 0.2.6.pre → 0.3.0.pre

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/bin/k9 +2 -2
  3. data/lib/jruby_art.rb +18 -23
  4. data/lib/jruby_art/app.rb +118 -130
  5. data/lib/jruby_art/config.rb +7 -9
  6. data/lib/jruby_art/creators/creator.rb +189 -0
  7. data/lib/jruby_art/helper_methods.rb +41 -31
  8. data/lib/jruby_art/helpers/camel_string.rb +2 -1
  9. data/lib/jruby_art/helpers/numeric.rb +1 -2
  10. data/lib/jruby_art/helpers/range.rb +3 -7
  11. data/lib/jruby_art/helpers/string_extra.rb +1 -1
  12. data/lib/jruby_art/library_loader.rb +127 -96
  13. data/lib/jruby_art/runner.rb +208 -63
  14. data/lib/jruby_art/runners/base.rb +51 -0
  15. data/lib/jruby_art/runners/run.rb +6 -0
  16. data/lib/jruby_art/runners/watch.rb +59 -0
  17. data/lib/jruby_art/version.rb +1 -2
  18. data/lib/rpextras.jar +0 -0
  19. data/library/library_proxy/README.md +97 -0
  20. data/library/library_proxy/library_proxy.rb +8 -1
  21. data/library/video_event/video_event.rb +4 -0
  22. data/vendors/Rakefile +33 -78
  23. metadata +54 -60
  24. data/CHANGELOG.md +0 -60
  25. data/LICENSE.md +0 -39
  26. data/README.md +0 -91
  27. data/Rakefile +0 -85
  28. data/lib/core.jar +0 -0
  29. data/lib/gluegen-rt-natives-linux-amd64.jar +0 -0
  30. data/lib/gluegen-rt-natives-linux-armv6hf.jar +0 -0
  31. data/lib/gluegen-rt-natives-linux-i586.jar +0 -0
  32. data/lib/gluegen-rt-natives-macosx-universal.jar +0 -0
  33. data/lib/gluegen-rt-natives-windows-amd64.jar +0 -0
  34. data/lib/gluegen-rt-natives-windows-i586.jar +0 -0
  35. data/lib/gluegen-rt.jar +0 -0
  36. data/lib/jogl-all-natives-linux-amd64.jar +0 -0
  37. data/lib/jogl-all-natives-linux-armv6hf.jar +0 -0
  38. data/lib/jogl-all-natives-linux-i586.jar +0 -0
  39. data/lib/jogl-all-natives-macosx-universal.jar +0 -0
  40. data/lib/jogl-all-natives-windows-amd64.jar +0 -0
  41. data/lib/jogl-all-natives-windows-i586.jar +0 -0
  42. data/lib/jogl-all.jar +0 -0
  43. data/lib/jruby_art/creator.rb +0 -100
  44. data/lib/jruby_art/parse.rb +0 -59
  45. data/lib/jruby_art/writer.rb +0 -40
  46. data/library/file_chooser/file_chooser.rb +0 -82
  47. data/library/grammar/grammar.rb +0 -31
  48. data/library/video/lib/export.txt +0 -1
  49. data/library/video/lib/macosx64.txt +0 -1
  50. data/library/video/lib/windows.txt +0 -3
  51. data/library/video/video.rb +0 -12
  52. data/spec/app_spec.rb +0 -208
  53. data/spec/deglut_spec.rb +0 -25
  54. data/spec/library_loader_spec.rb +0 -23
  55. data/spec/spec_helper.rb +0 -96
  56. data/spec/vecmath_spec.rb +0 -483
  57. data/vendors/config.tar.gz +0 -0
data/spec/vecmath_spec.rb DELETED
@@ -1,483 +0,0 @@
1
- require_relative '../lib/jruby_art'
2
-
3
- Java::ProcessingVecmathVec2::Vec2Library.new.load(JRuby.runtime, false)
4
-
5
- EPSILON = 1.0e-04
6
-
7
- describe 'Vec2D#to_a' do
8
- it 'should return x, y as an array' do
9
- x, y = 1.0000001, 1.01
10
- a = Vec2D.new(x, y)
11
- expect(a.to_a).to eq([x, y])
12
- end
13
- end
14
-
15
- describe 'Vec2D#copy' do
16
- it 'should return a deep copy' do
17
- x, y = 1.0000001, 1.01
18
- a = Vec2D.new(x, y)
19
- expect(a.copy.to_a).to eq([x, y])
20
- end
21
- end
22
-
23
- describe 'Vec2D#copy' do
24
- it 'should return a deep copy' do
25
- x, y = 1.0000001, 1.01
26
- a = Vec2D.new(x, y)
27
- b = a.copy
28
- b *= 0
29
- expect(a.to_a).not_to eq(b.to_a)
30
- end
31
- end
32
-
33
- describe 'Vec2D#==' do
34
- it 'should return a == b' do
35
- a = Vec2D.new(3, 5)
36
- b = Vec2D.new(6, 7)
37
- expect(a == b).to be false
38
- end
39
- end
40
-
41
- describe 'Vec2D#eql?' do
42
- it 'should return a.eql? b' do
43
- a = Vec2D.new(3.0, 5.0)
44
- b = Vec2D.new(3.0, 5.0)
45
- expect(a.eql?(b)).to be true
46
- end
47
- end
48
-
49
- describe 'Vec2D#eql?' do
50
- it 'should return a.eql? b' do
51
- a = Vec2D.new(3.0, 5.0)
52
- b = Vec2D.new(3.0, 5.000001)
53
- expect(a.eql?(b)).to be false
54
- end
55
- end
56
-
57
- describe 'Vec2D#equal?' do
58
- it 'should return a.eql? b' do
59
- a = Vec2D.new(3.0, 5.0)
60
- expect(a.equal?(a)).to be true
61
- end
62
- end
63
-
64
- describe 'Vec2D#equal?' do
65
- it 'should return a.eql? b' do
66
- a = Vec2D.new(3.0, 5.0)
67
- b = Vec2D.new(3.0, 5.0)
68
- expect(a.equal?(b)).to be false
69
- end
70
- end
71
-
72
- describe 'Vec2D#==' do
73
- it 'should return a == b' do
74
- a = Vec2D.new(3.0000000, 5.00000)
75
- b = Vec2D.new(3.0000000, 5.000001)
76
- expect(a == b).to be true
77
- end
78
- end
79
-
80
- describe 'Vec2D#+' do
81
- it 'should return Vec2D sum of a + b' do
82
- a = Vec2D.new(3, 5)
83
- b = Vec2D.new(6, 7)
84
- expect(a + b).to eq Vec2D.new(9, 12)
85
- end
86
- end
87
-
88
- describe 'Vec2D#-' do
89
- it 'should return Vec2D sum of a - b' do
90
- a = Vec2D.new(3, 5)
91
- b = Vec2D.new(6, 7)
92
- expect(a - b).to eq Vec2D.new(-3, -2)
93
- end
94
- end
95
-
96
-
97
- describe 'Vec2D#*' do
98
- it 'should return Vec2D sum of a * b' do
99
- a = Vec2D.new(3, 5)
100
- b = 2
101
- expect(a * b).to eq Vec2D.new(6, 10)
102
- end
103
- end
104
-
105
- describe 'Vec2D#from_angle' do
106
- it 'should return Vec2D.from_angle' do
107
- a = Vec2D.from_angle(Math::PI / 4.0)
108
- expect(a).to eq Vec2D.new(Math.sqrt(0.5), Math.sqrt(0.5))
109
- end
110
- end
111
-
112
- describe 'Vec2D#from_angle' do
113
- it 'should return Vec2D.from_angle' do
114
- a = Vec2D.from_angle(Math::PI * 0.75)
115
- expect(a).to eq Vec2D.new(-1 * Math.sqrt(0.5), Math.sqrt(0.5))
116
- end
117
- end
118
-
119
- describe 'Vec2D2#x=' do
120
- it 'should set x to supplied value' do
121
- a = Vec2D.new(3, 5)
122
- a.x=23
123
- expect(a.x).to eq 23.0
124
- end
125
- end
126
-
127
- describe 'Vec2D mag' do
128
- it 'should return Vec2D mag' do
129
- a = Vec2D.new(-3, -4)
130
- expect(a.mag).to eq 5
131
- end
132
- end
133
-
134
- describe 'Vec2D mag' do
135
- it 'should return Vec2D mag' do
136
- a = Vec2D.new(3.0, 2)
137
- expect(a.mag).to be_within(EPSILON).of(Math.sqrt(3.0**2 + 2**2))
138
- end
139
- end
140
-
141
- describe 'Vec2D mag' do
142
- it 'should return Vec2D dist' do
143
- a = Vec2D.new(3, 4)
144
- expect(a.mag).to eq(5)
145
- end
146
- end
147
-
148
- describe 'Vec2D mag' do
149
- it 'should return Vec2D dist' do
150
- a = Vec2D.new(-1, 0)
151
- expect(a.mag).to eq(1)
152
- end
153
- end
154
-
155
-
156
- describe 'Vec2D lerp' do
157
- it 'should return Vec2D lerp' do
158
- a = Vec2D.new(1, 1)
159
- b = Vec2D.new(3, 3)
160
- expect(a.lerp(b, 0.5)).to eq Vec2D.new(2, 2)
161
- end
162
- end
163
-
164
- describe 'Vec2D lerp' do
165
- it 'should return Vec2D lerp' do
166
- a = Vec2D.new(1, 1)
167
- b = Vec2D.new(3, 3)
168
- expect(a.lerp(b, 5)).to eq Vec2D.new(11, 11)
169
- end
170
- end
171
-
172
- describe 'Vec2D lerp!' do
173
- it 'should return Vec2D lerp!' do
174
- a = Vec2D.new(1, 1)
175
- b = Vec2D.new(3, 3)
176
- a.lerp!(b, 0.5)
177
- expect(a).to eq Vec2D.new(2, 2)
178
- end
179
- end
180
-
181
- describe 'Vec2D lerp!' do
182
- it 'should return Vec2D lerp!' do
183
- a = Vec2D.new(1, 1)
184
- b = Vec2D.new(3, 3)
185
- a.lerp!(b, -0.5)
186
- expect(a).to eq Vec2D.new(0, 0)
187
- end
188
- end
189
-
190
- describe 'Vec2D#set_mag' do
191
- it 'should return Vec2D#set_mag' do
192
- a = Vec2D.new(1, 1)
193
- expect(a.set_mag(Math.sqrt(32))).to eq Vec2D.new(4, 4)
194
- end
195
- end
196
-
197
- describe 'Vec2D#set_mag_block_false' do
198
- it 'should return Vec2D#set_mag' do
199
- a = Vec2D.new(1, 1)
200
- expect(a.set_mag(Math.sqrt(32)) { false }).to eq Vec2D.new(1, 1)
201
- end
202
- end
203
-
204
- describe 'Vec2D#set_mag_block_true' do
205
- it 'sho uld return Vec2D#set_mag' do
206
- a = Vec2D.new(1, 1)
207
- expect(a.set_mag(Math.sqrt(32)) { true }).to eq Vec2D.new(4, 4)
208
- end
209
- end
210
-
211
- describe 'Vec2D dist' do
212
- it 'should return a.dist(b)' do
213
- a = Vec2D.new(3, 5)
214
- b = Vec2D.new(6, 7)
215
- expect(a.dist(b)).to eq Math.sqrt(3.0**2 + 2**2)
216
- end
217
- end
218
-
219
-
220
- describe 'Vec2D dot' do
221
- it 'should return Vec2D dist(a, b)' do
222
- a = Vec2D.new(3, 5)
223
- b = Vec2D.new(6, 7)
224
- expect(a.dot(b)).to eq 53
225
- end
226
- end
227
-
228
- describe 'Vec2D #/' do
229
- it 'should return Vec2D sum of a * b' do
230
- a = Vec2D.new(6, 10)
231
- b = 2
232
- expect(a / b).to eq Vec2D.new(3, 5)
233
- end
234
- end
235
-
236
- describe 'Vec2D #+=' do
237
- it 'should return Vec2D result of a += b' do
238
- a = Vec2D.new(3, 5)
239
- b = Vec2D.new(6, 7)
240
- a += b
241
- expect(a).to eq Vec2D.new(9, 12)
242
- end
243
- end
244
-
245
- describe 'Vec2D#normalize' do
246
- it 'should return Vec2D#normalize a new Vec2D with mag 1.0' do
247
- a = Vec2D.new(3, 5)
248
- b = a.normalize
249
- expect(b.mag).to be_within(EPSILON).of(1.0)
250
- end
251
- end
252
-
253
- describe 'Vec2D#normalize!' do
254
- it 'should return Vec2D#normalize! Vec2D#mag == 1.0' do
255
- a = Vec2D.new(3, 5)
256
- a.normalize!
257
- expect(a.mag).to be_within(EPSILON).of(1.0)
258
- end
259
- end
260
-
261
- describe 'Vec2D#heading' do
262
- it 'should return Vec2D#heading in radians' do
263
- a = Vec2D.new(1, 1)
264
- expect(a.heading).to be_within(EPSILON).of(Math::PI / 4.0)
265
- end
266
- end
267
-
268
- describe 'Vec2D#inspect' do
269
- it 'should return a String' do
270
- a = Vec2D.new(3, 2.000000000000001)
271
- expect(a.inspect).to eq 'Vec2D(x = 3.0000, y = 2.0000)'
272
- end
273
- end
274
-
275
- describe 'Vec2D#to_a' do
276
- it 'should return x, y as an array' do
277
- x, y = 1.0000001, 1.01
278
- a = Vec2D.new(x, y)
279
- expect(a.to_a).to eq([x, y])
280
- end
281
- end
282
-
283
- describe 'Vec2D#array.reduce' do
284
- it 'should correctly sum objects of Vec2D' do
285
- array = [Vec2D.new(1, 2), Vec2D.new(10, 2), Vec2D.new(1, 2)]
286
- sum = array.reduce(Vec2D.new) { |c, d| c + d }
287
- expect(sum).to eq(Vec2D.new(12, 6))
288
- end
289
- end
290
-
291
- describe 'Vec2D#array.zip(Vec2D#array)' do
292
- it 'should correctly zip arrays of Vec2D' do
293
- one = [Vec2D.new(1, 2), Vec2D.new(10, 2), Vec2D.new(1, 2)]
294
- two = [Vec2D.new(1, 2), Vec2D.new(10, 2), Vec2D.new(1, 2)]
295
- zipped = one.zip(two).flatten
296
- puts zipped
297
- expect(zipped).to eq([Vec2D.new(1, 2), Vec2D.new(1, 2), Vec2D.new(10, 2), Vec2D.new(10, 2), Vec2D.new(1, 2), Vec2D.new(1, 2)])
298
- end
299
- end
300
-
301
- describe 'Vec2D#rotate rot' do
302
- it 'should return a rotated vector with same mag' do
303
- x, y = 20, 10
304
- b = Vec2D.new(x, y)
305
- a = b.rotate(Math::PI / 2)
306
- expect(a).to eq(Vec2D.new(-10.0, 20.0))
307
- end
308
- end
309
-
310
- describe 'Vec3D#to_a' do
311
- it 'should return x, y, z as an array' do
312
- x, y, z = 1.0000001, 1.01, 0.999999
313
- a = Vec3D.new(x, y, z)
314
- expect(a.to_a).to eq([x, y, z])
315
- end
316
- end
317
-
318
- describe 'Vec3D#copy' do
319
- it 'should return a deep copy' do
320
- x, y, z = 1.0000001, 1.01, 0.999999
321
- a = Vec3D.new(x, y, z)
322
- expect(a.copy.to_a).to eq([x, y, z])
323
- end
324
- end
325
-
326
- describe 'Vec3D#copy' do
327
- it 'should produce a new object' do
328
- x, y, z = 1.0000001, 1.01, 0.999999
329
- a = Vec3D.new(x, y, z)
330
- b = a.copy
331
- b.normalize!
332
- expect(a).not_to eq(b)
333
- end
334
- end
335
-
336
- describe 'Vec3D#normalize! zero vector' do
337
- it 'should do nothing' do
338
- a = Vec3D.new
339
- b = a.normalize!
340
- expect(a).to eq(b)
341
- end
342
- end
343
-
344
- describe 'Vec3D#normalize zero vector' do
345
- it 'should do nothing' do
346
- a = Vec3D.new
347
- b = a.normalize
348
- expect(a).to eq(b)
349
- expect(a).to_not equal(b)
350
- end
351
- end
352
-
353
- describe 'Vec3D#dist_squared' do
354
- it 'should return Vec3D.dist_squared(a, b)' do
355
- a = Vec3D.new(3, 5, 2)
356
- b = Vec3D.new(6, 7, 1)
357
- expect(a.dist_squared(b)).to eq 3.0**2 + 2**2 + 1
358
- end
359
- end
360
-
361
- describe 'Vec3D#dist' do
362
- it 'should return Vec3D.dist(a, b)' do
363
- a = Vec3D.new(3, 5, 2)
364
- b = Vec3D.new(6, 7, 1)
365
- expect(a.dist(b)).to eq Math.sqrt(3.0**2 + 2**2 + 1)
366
- end
367
- end
368
-
369
- describe 'Vec3D#normalize' do
370
- it 'should return Vec3D#normalize a new Vec3D with mag == 1.0' do
371
- a = Vec3D.new(3, 5, 2)
372
- b = a.normalize
373
- expect(b.mag).to be_within(EPSILON).of(1.0)
374
- end
375
- end
376
-
377
- describe 'Vec3D#normalize!' do
378
- it 'should return Vec3D#normalize! Vec3D#mag == 1.0' do
379
- a = Vec3D.new(3, 5, 2)
380
- a.normalize!
381
- expect(a.mag).to be_within(EPSILON).of(1.0)
382
- end
383
- end
384
-
385
- describe 'Vec3D#set_mag zero vector' do
386
- it 'should return zero vector' do
387
- a = Vec3D.new(0, 0, 0)
388
- expect(a.set_mag(Math.sqrt(48))).to eq Vec3D.new(0, 0, 0)
389
- end
390
- end
391
-
392
- describe 'Vec3D#set_mag' do
393
- it 'should return Vec3D#set_mag' do
394
- a = Vec3D.new(1, 1, 1)
395
- expect(a.set_mag(Math.sqrt(48))).to eq Vec3D.new(4, 4, 4)
396
- end
397
- end
398
-
399
- describe 'Vec3D#cross product' do
400
- it 'should return Vec3D.cross(vec)' do
401
- a = Vec3D.new(3, 5, 2)
402
- b = Vec3D.new(6, 7, 1)
403
- expect(a.cross(b)).to eq Vec3D.new(-9.0, 9.0, -9.0)
404
- end
405
- end
406
-
407
- describe 'Vec3D#set_mag negative block' do
408
- it 'should return Vec3D#set_mag' do
409
- a = Vec3D.new(1, 1, 1)
410
- expect(a.set_mag(Math.sqrt(48)) { false }).to eq a
411
- end
412
- end
413
-
414
- describe 'Vec3D#inspect' do
415
- it 'should return a String' do
416
- a = Vec3D.new(3, 5, 2.000000000000001)
417
- expect(a.inspect).to eq 'Vec3D(x = 3.0000, y = 5.0000, z = 2.0000)'
418
- end
419
- end
420
-
421
- describe 'Vec3D#set_mag positive block' do
422
- it 'should return Vec3D#set_mag' do
423
- a = Vec3D.new(1, 1, 1)
424
- expect(a.set_mag(Math.sqrt(48)) { true }).to eq Vec3D.new(4, 4, 4)
425
- end
426
- end
427
-
428
- describe 'Vec3D#to_a' do
429
- it 'should return x, y as an array' do
430
- x, y, z = 1.0000001, 1.01, 1.001
431
- a = Vec3D.new(x, y, z)
432
- expect(a.to_a).to eq([x, y, z])
433
- end
434
- end
435
-
436
- describe 'Vec3D#z=' do
437
- it 'should set z value' do
438
- x, y, z = 1.0000001, 1.01, 1.001
439
- a = Vec3D.new(x, y, z)
440
- w = 56.0
441
- a.z = w
442
- expect(a.z).to eq(w)
443
- end
444
- end
445
-
446
- describe 'Vec3D#==' do
447
- it 'should return a == b' do
448
- a = Vec3D.new(3.0, 5.0, 0)
449
- b = Vec3D.new(3.0, 5.000001, 0)
450
- expect(a == b).to be true
451
- end
452
- end
453
-
454
- describe 'Vec3D#eql?' do
455
- it 'should return a.eql? b' do
456
- a = Vec3D.new(3.0, 5.0, 0)
457
- b = Vec3D.new(3.0, 5.0, 0)
458
- expect(a.eql?(b)).to be true
459
- end
460
- end
461
-
462
- describe 'Vec3D#eql?' do
463
- it 'should return a.eql? b' do
464
- a = Vec3D.new(3.0, 5.0, 0)
465
- b = Vec3D.new(3.0, 5.000001, 0)
466
- expect(a.eql?(b)).to be false
467
- end
468
- end
469
-
470
- describe 'Vec3D#equal?' do
471
- it 'should return a.eql? b' do
472
- a = Vec3D.new(3.0, 5.0)
473
- expect(a.equal?(a)).to be true
474
- end
475
- end
476
-
477
- describe 'Vec3D#equal?' do
478
- it 'should return a.eql? b' do
479
- a = Vec3D.new(3.0, 5.0, 0)
480
- b = Vec3D.new(3.0, 5.0, 0)
481
- expect(a.equal?(b)).to be false
482
- end
483
- end