propane 3.4.1-java → 3.7.1-java
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/.mvn/extensions.xml +1 -1
- data/.mvn/wrapper/MavenWrapperDownloader.java +2 -2
- data/.mvn/wrapper/maven-wrapper.properties +2 -2
- data/.travis.yml +1 -1
- data/CHANGELOG.md +9 -1
- data/Gemfile +2 -0
- data/README.md +9 -5
- data/Rakefile +10 -11
- data/bin/propane +3 -1
- data/lib/propane.rb +4 -2
- data/lib/propane/app.rb +2 -1
- data/lib/propane/creators/sketch_class.rb +7 -1
- data/lib/propane/creators/sketch_factory.rb +4 -2
- data/lib/propane/creators/sketch_writer.rb +1 -0
- data/lib/propane/helper_methods.rb +22 -23
- data/lib/propane/helpers/numeric.rb +2 -0
- data/lib/propane/helpers/version_error.rb +1 -0
- data/lib/propane/library.rb +5 -1
- data/lib/propane/library_loader.rb +2 -0
- data/lib/propane/native_folder.rb +10 -9
- data/lib/propane/native_loader.rb +3 -0
- data/lib/propane/runner.rb +20 -14
- data/lib/propane/version.rb +2 -1
- data/library/boids/boids.rb +21 -11
- data/library/color_group/color_group.rb +2 -0
- data/library/control_panel/control_panel.rb +8 -5
- data/library/dxf/dxf.rb +2 -0
- data/library/file_chooser/chooser.rb +10 -9
- data/library/file_chooser/file_chooser.rb +10 -9
- data/library/library_proxy/library_proxy.rb +2 -0
- data/library/net/net.rb +2 -0
- data/library/simplex_noise/simplex_noise.rb +2 -0
- data/library/slider/slider.rb +23 -22
- data/library/vector_utils/vector_utils.rb +4 -0
- data/library/video_event/video_event.rb +2 -0
- data/pom.rb +37 -36
- data/pom.xml +6 -6
- data/propane.gemspec +12 -10
- data/src/main/java/japplemenubar/JAppleMenuBar.java +3 -3
- data/src/main/java/monkstone/ColorUtil.java +1 -3
- data/src/main/java/monkstone/MathToolModule.java +10 -9
- data/src/main/java/monkstone/PropaneLibrary.java +2 -2
- data/src/main/java/monkstone/fastmath/Deglut.java +1 -1
- data/src/main/java/monkstone/filechooser/Chooser.java +1 -1
- data/src/main/java/monkstone/noise/SimplexNoise.java +2 -2
- data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SliderBar.java +1 -1
- data/src/main/java/monkstone/slider/SliderGroup.java +1 -1
- data/src/main/java/monkstone/slider/WheelHandler.java +1 -1
- data/src/main/java/monkstone/vecmath/package-info.java +1 -1
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +1 -1
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -2
- data/src/main/java/monkstone/videoevent/CaptureEvent.java +1 -1
- data/src/main/java/monkstone/videoevent/MovieEvent.java +1 -1
- data/src/main/java/monkstone/videoevent/package-info.java +1 -1
- data/src/main/java/processing/awt/PGraphicsJava2D.java +781 -285
- data/src/main/java/processing/awt/PImageAWT.java +377 -0
- data/src/main/java/processing/awt/PShapeJava2D.java +56 -52
- data/src/main/java/processing/awt/PSurfaceAWT.java +308 -208
- data/src/main/java/processing/awt/ShimAWT.java +581 -0
- data/src/main/java/processing/core/PApplet.java +4225 -4855
- data/src/main/java/processing/core/PConstants.java +477 -447
- data/src/main/java/processing/core/PFont.java +914 -880
- data/src/main/java/processing/core/PGraphics.java +150 -134
- data/src/main/java/processing/core/PImage.java +275 -372
- data/src/main/java/processing/core/PMatrix.java +172 -159
- data/src/main/java/processing/core/PMatrix2D.java +478 -415
- data/src/main/java/processing/core/PMatrix3D.java +762 -735
- data/src/main/java/processing/core/PShape.java +2887 -2651
- data/src/main/java/processing/core/PShapeOBJ.java +97 -92
- data/src/main/java/processing/core/PShapeSVG.java +1705 -1490
- data/src/main/java/processing/core/PStyle.java +40 -37
- data/src/main/java/processing/core/PSurface.java +139 -97
- data/src/main/java/processing/core/PSurfaceNone.java +296 -218
- data/src/main/java/processing/core/PVector.java +995 -963
- data/src/main/java/processing/core/ThinkDifferent.java +12 -8
- data/src/main/java/processing/data/DoubleDict.java +756 -710
- data/src/main/java/processing/data/DoubleList.java +749 -696
- data/src/main/java/processing/data/FloatDict.java +748 -702
- data/src/main/java/processing/data/FloatList.java +751 -697
- data/src/main/java/processing/data/IntDict.java +720 -673
- data/src/main/java/processing/data/IntList.java +699 -633
- data/src/main/java/processing/data/JSONArray.java +931 -873
- data/src/main/java/processing/data/JSONObject.java +1262 -1165
- data/src/main/java/processing/data/JSONTokener.java +351 -341
- data/src/main/java/processing/data/LongDict.java +710 -663
- data/src/main/java/processing/data/LongList.java +701 -635
- data/src/main/java/processing/data/Sort.java +37 -41
- data/src/main/java/processing/data/StringDict.java +525 -486
- data/src/main/java/processing/data/StringList.java +626 -580
- data/src/main/java/processing/data/Table.java +3690 -3510
- data/src/main/java/processing/data/TableRow.java +182 -183
- data/src/main/java/processing/data/XML.java +957 -883
- data/src/main/java/processing/event/Event.java +87 -67
- data/src/main/java/processing/event/KeyEvent.java +48 -41
- data/src/main/java/processing/event/MouseEvent.java +88 -113
- data/src/main/java/processing/event/TouchEvent.java +10 -6
- data/src/main/java/processing/javafx/PGraphicsFX2D.java +20 -345
- data/src/main/java/processing/javafx/PSurfaceFX.java +149 -121
- data/src/main/java/processing/net/Client.java +20 -20
- data/src/main/java/processing/net/Server.java +9 -9
- data/src/main/java/processing/opengl/FontTexture.java +286 -266
- data/src/main/java/processing/opengl/FrameBuffer.java +389 -377
- data/src/main/java/processing/opengl/LinePath.java +132 -89
- data/src/main/java/processing/opengl/LineStroker.java +588 -581
- data/src/main/java/processing/opengl/PGL.java +660 -567
- data/src/main/java/processing/opengl/PGraphics2D.java +408 -315
- data/src/main/java/processing/opengl/PGraphics3D.java +107 -72
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +12378 -12075
- data/src/main/java/processing/opengl/PJOGL.java +1753 -1670
- data/src/main/java/processing/opengl/PShader.java +369 -461
- data/src/main/java/processing/opengl/PShapeOpenGL.java +4678 -4580
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +1114 -1027
- data/src/main/java/processing/opengl/Texture.java +1492 -1401
- data/src/main/java/processing/opengl/VertexBuffer.java +57 -55
- data/test/create_test.rb +21 -20
- data/test/deglut_spec_test.rb +4 -2
- data/test/helper_methods_test.rb +49 -20
- data/test/math_tool_test.rb +39 -32
- data/test/native_folder.rb +47 -0
- data/test/respond_to_test.rb +3 -2
- data/test/sketches/key_event.rb +2 -2
- data/test/sketches/library/my_library/my_library.rb +3 -0
- data/test/test_helper.rb +2 -0
- data/test/vecmath_spec_test.rb +35 -22
- data/vendors/Rakefile +35 -40
- metadata +42 -22
- data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +0 -154
- data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +0 -154
- data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +0 -160
- data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +0 -160
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# This class knows how to dynamically set the 'java' native library path
|
2
4
|
# It might not work with java 9?
|
3
5
|
class NativeLoader
|
@@ -21,6 +23,7 @@ class NativeLoader
|
|
21
23
|
field = JC::Class.for_name('java.lang.ClassLoader')
|
22
24
|
.get_declared_field('sys_paths')
|
23
25
|
return unless field
|
26
|
+
|
24
27
|
field.accessible = true # some jruby magic
|
25
28
|
field.set(JC::Class.for_name('java.lang.System').get_class_loader, nil)
|
26
29
|
end
|
data/lib/propane/runner.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: false
|
2
|
+
|
2
3
|
require 'optparse'
|
3
4
|
require_relative 'version'
|
4
5
|
|
@@ -54,6 +55,8 @@ module Propane
|
|
54
55
|
# assumed to have this option.
|
55
56
|
opts.on('-h', '--help', 'Display this screen') do
|
56
57
|
puts opts
|
58
|
+
puts ''
|
59
|
+
puts 'Run a sketch: jruby [--dev] [<sketch.rb>]'
|
57
60
|
exit
|
58
61
|
end
|
59
62
|
end
|
@@ -66,28 +69,31 @@ module Propane
|
|
66
69
|
SketchWriter.new(File.basename(filename, '.rb'), argc).write
|
67
70
|
end
|
68
71
|
|
69
|
-
def show_version
|
70
|
-
|
71
|
-
v_format = "Propane version %s\nJRuby version %s"
|
72
|
-
puts format(v_format, Propane::VERSION, JRUBY_VERSION)
|
73
|
-
end
|
74
|
-
|
75
72
|
def show_version
|
76
73
|
require 'erb'
|
77
74
|
require_relative 'helpers/version_error'
|
78
|
-
raise JDKVersionError
|
79
|
-
|
75
|
+
raise JDKVersionError if ENV_JAVA['java.specification.version'] < '11'
|
76
|
+
|
77
|
+
template = ERB.new <<-VERSION
|
80
78
|
propane version <%= Propane::VERSION %>
|
81
79
|
JRuby version <%= JRUBY_VERSION %>
|
82
|
-
|
80
|
+
VERSION
|
83
81
|
puts template.result(binding)
|
84
82
|
end
|
85
83
|
|
86
84
|
def install(library)
|
85
|
+
library ||= 'new'
|
87
86
|
choice = library.downcase
|
88
|
-
|
89
|
-
|
90
|
-
|
87
|
+
case choice
|
88
|
+
when /samples|sound|video/
|
89
|
+
system "cd #{PROPANE_ROOT}/vendors && rake download_and_copy_#{choice}"
|
90
|
+
when /new/
|
91
|
+
system "cd #{PROPANE_ROOT}/vendors && rake download_and_copy_samples"
|
92
|
+
else
|
93
|
+
warn format('No installer for %<lib>s', lib: choice)
|
94
|
+
end
|
91
95
|
end
|
92
|
-
end
|
93
|
-
|
96
|
+
end
|
97
|
+
# class Runner
|
98
|
+
end
|
99
|
+
# module Propane
|
data/lib/propane/version.rb
CHANGED
data/library/boids/boids.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Boids -- after Tom de Smedt.
|
2
4
|
# See his Python version: http://nodebox.net/code/index.php/Boids
|
3
5
|
# This is an example of how a pure-Ruby library can work. Original for
|
@@ -7,7 +9,8 @@ class Boid
|
|
7
9
|
attr_accessor :boids, :pos, :vel, :is_perching, :perch_time
|
8
10
|
|
9
11
|
def initialize(boids, pos)
|
10
|
-
@boids
|
12
|
+
@boids = boids
|
13
|
+
@flock = boids
|
11
14
|
@pos = pos
|
12
15
|
@vel = Vec3D.new
|
13
16
|
@is_perching = false
|
@@ -53,6 +56,7 @@ class Boid
|
|
53
56
|
# Tweet, Tweet! The boid police will bust you for breaking the speed limit.
|
54
57
|
most = [vel.x.abs, vel.y.abs, vel.z.abs].max
|
55
58
|
return if most < max
|
59
|
+
|
56
60
|
scale = max / most.to_f
|
57
61
|
@vel *= scale
|
58
62
|
end
|
@@ -75,7 +79,7 @@ class Boids
|
|
75
79
|
extend Forwardable
|
76
80
|
def_delegators(:@boids, :reject, :<<, :each, :shuffle!, :length, :next)
|
77
81
|
|
78
|
-
attr_reader :has_goal, :
|
82
|
+
attr_reader :has_goal, :perchance, :perch_tm, :perch_y
|
79
83
|
|
80
84
|
def initialize
|
81
85
|
@boids = []
|
@@ -88,16 +92,20 @@ class Boids
|
|
88
92
|
|
89
93
|
def setup(n, x, y, w, h)
|
90
94
|
n.times do
|
91
|
-
dx
|
95
|
+
dx = rand(w)
|
96
|
+
dy = rand(h)
|
92
97
|
z = rand(200.0)
|
93
98
|
self << Boid.new(self, Vec3D.new(x + dx, y + dy, z))
|
94
99
|
end
|
95
|
-
@x
|
100
|
+
@x = x
|
101
|
+
@y = y
|
102
|
+
@w = w
|
103
|
+
@h = h
|
96
104
|
@scattered = false
|
97
105
|
@scatter = 0.005
|
98
106
|
@scatter_time = 50.0
|
99
107
|
@scatter_i = 0.0
|
100
|
-
@
|
108
|
+
@perchance = 1.0 # Lower this number to divebomb.
|
101
109
|
@perch_y = h
|
102
110
|
@perch_tm = -> { 25.0 + rand(50.0) }
|
103
111
|
@has_goal = false
|
@@ -118,11 +126,11 @@ class Boids
|
|
118
126
|
def perch(ground = nil, chance = 1.0, frames = nil)
|
119
127
|
@perch_tm = frames.nil? ? -> { 25.0 + rand(50.0) } : frames
|
120
128
|
@perch_y = ground.nil? ? @h : ground
|
121
|
-
@
|
129
|
+
@perchance = chance
|
122
130
|
end
|
123
131
|
|
124
132
|
def no_perch
|
125
|
-
@
|
133
|
+
@perchance = 0.0
|
126
134
|
end
|
127
135
|
|
128
136
|
def goal(target:, flee: false)
|
@@ -138,7 +146,8 @@ class Boids
|
|
138
146
|
|
139
147
|
def constrain
|
140
148
|
# Put them boids in a cage.
|
141
|
-
dx
|
149
|
+
dx = @w * 0.1
|
150
|
+
dy = @h * 0.1
|
142
151
|
each do |b|
|
143
152
|
b.vel.x += rand(dx) if b.pos.x < @x - dx
|
144
153
|
b.vel.x += rand(dy) if b.pos.y < @y - dy
|
@@ -146,9 +155,10 @@ class Boids
|
|
146
155
|
b.vel.y -= rand(dy) if b.pos.y > @y + @h + dy
|
147
156
|
b.vel.z += 10.0 if b.pos.z < 0.0
|
148
157
|
b.vel.z -= 10.0 if b.pos.z > 100.0
|
149
|
-
next unless b.pos.y > perch_y && rand <
|
158
|
+
next unless b.pos.y > perch_y && rand < perchance
|
159
|
+
|
150
160
|
b.pos.y = perch_y
|
151
|
-
b.vel.y = -
|
161
|
+
b.vel.y = -b.vel.y.abs * 0.2
|
152
162
|
b.is_perching = true
|
153
163
|
b.perch_time = perch_tm.respond_to?(:call) ? perch_tm.call : perch_tm
|
154
164
|
end
|
@@ -166,7 +176,7 @@ class Boids
|
|
166
176
|
m2 = 1.0 # separation
|
167
177
|
m3 = 1.0 # alignment
|
168
178
|
m4 = 1.0 # goal
|
169
|
-
@scattered = true if
|
179
|
+
@scattered = true if !@scattered && rand < @scatter
|
170
180
|
if @scattered
|
171
181
|
m1 = -m1
|
172
182
|
m3 *= 0.25
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Here's a little library for quickly hooking up controls to sketches.
|
2
4
|
# For messing with the parameters and such.
|
3
5
|
# These controls will set instance variables on the sketches.
|
@@ -25,7 +27,7 @@ module ControlPanel
|
|
25
27
|
add_change_listener do
|
26
28
|
update_label(label, name, value)
|
27
29
|
ControlPanel.app_value(name, value)
|
28
|
-
proc
|
30
|
+
proc&.call(value)
|
29
31
|
end
|
30
32
|
ControlPanel.app_value(name, val)
|
31
33
|
end
|
@@ -49,7 +51,7 @@ module ControlPanel
|
|
49
51
|
control_panel.add_element(self, name)
|
50
52
|
add_action_listener do
|
51
53
|
ControlPanel.app_value(name, value) unless value.nil?
|
52
|
-
proc
|
54
|
+
proc&.call(value)
|
53
55
|
end
|
54
56
|
set_selected_index(initial_value ? elements.index(initial_value) : 0)
|
55
57
|
end
|
@@ -69,7 +71,7 @@ module ControlPanel
|
|
69
71
|
control_panel.add_element(self, name, false)
|
70
72
|
add_action_listener do
|
71
73
|
ControlPanel.app_value(name, value)
|
72
|
-
proc
|
74
|
+
proc&.call(value)
|
73
75
|
end
|
74
76
|
end
|
75
77
|
|
@@ -87,7 +89,7 @@ module ControlPanel
|
|
87
89
|
control_panel.add_element(self, name, false, true)
|
88
90
|
add_action_listener do
|
89
91
|
Propane.app.send(name)
|
90
|
-
proc
|
92
|
+
proc&.call(value)
|
91
93
|
end
|
92
94
|
end
|
93
95
|
end
|
@@ -160,7 +162,7 @@ module ControlPanel
|
|
160
162
|
def feel(lf = 'metal')
|
161
163
|
lafinfo = javax.swing.UIManager.getInstalledLookAndFeels
|
162
164
|
laf = lafinfo.to_ary.find do |info|
|
163
|
-
|
165
|
+
Regexp.new(Regexp.escape(lf), Regexp::IGNORECASE).match?(info.name)
|
164
166
|
end
|
165
167
|
javax.swing.UIManager.setLookAndFeel(laf.class_name)
|
166
168
|
end
|
@@ -171,6 +173,7 @@ module ControlPanel
|
|
171
173
|
def control_panel
|
172
174
|
@control_panel ||= ControlPanel::Panel.new
|
173
175
|
return @control_panel unless block_given?
|
176
|
+
|
174
177
|
yield(@control_panel)
|
175
178
|
@control_panel.display
|
176
179
|
@control_panel.set_visible true
|
data/library/dxf/dxf.rb
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
# Usage: :wq
|
3
4
|
# load_library :chooser
|
4
|
-
#
|
5
|
+
#
|
5
6
|
# def setup
|
6
|
-
|
7
|
-
|
7
|
+
# java_signature 'void selectInput(String, String)'
|
8
|
+
# selectInput('Select a file to process:', 'fileSelected')
|
8
9
|
# end
|
9
|
-
#
|
10
|
+
#
|
10
11
|
# def fileSelected(selection)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
# if selection.nil?
|
13
|
+
# puts 'Window was closed or the user hit cancel.'
|
14
|
+
# else
|
15
|
+
# puts format('User selected %s', selection.get_absolute_path)
|
16
|
+
# end
|
16
17
|
# end
|
17
18
|
class Propane::App
|
18
19
|
include Java::MonkstoneFilechooser::Chooser
|
@@ -1,18 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
|
+
# Usage:
|
3
4
|
# load_library :file_chooser
|
4
5
|
# class ...
|
5
6
|
# def setup
|
6
|
-
|
7
|
-
|
7
|
+
# java_signature 'void selectInput(String, String)'
|
8
|
+
# selectInput('Select a file to process:', 'fileSelected')
|
8
9
|
# end
|
9
|
-
#
|
10
|
+
#
|
10
11
|
# def fileSelected(selection)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
# if selection.nil?
|
13
|
+
# puts 'Window was closed or the user hit cancel.'
|
14
|
+
# else
|
15
|
+
# puts format('User selected %s', selection.get_absolute_path)
|
16
|
+
# end
|
16
17
|
# end
|
17
18
|
# ...
|
18
19
|
class Propane::App
|
data/library/net/net.rb
CHANGED
data/library/slider/slider.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
# Here's a little library for quickly hooking up in sketch sliders.
|
3
|
-
# Copyright (c)
|
4
|
+
# Copyright (c) 2015-20 Martin Prout.
|
4
5
|
|
5
6
|
java_import 'monkstone.slider.CustomHorizontalSlider'
|
6
7
|
java_import 'monkstone.slider.CustomVerticalSlider'
|
@@ -9,27 +10,27 @@ java_import 'monkstone.slider.CustomVerticalSlider'
|
|
9
10
|
module Slider
|
10
11
|
def self.slider(app:, x:, y:, name:, **opts)
|
11
12
|
options = default.merge opts
|
12
|
-
if options[:vertical]
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
slider = if options[:vertical]
|
14
|
+
CustomVerticalSlider.new(
|
15
|
+
app,
|
16
|
+
x,
|
17
|
+
y,
|
18
|
+
options[:length],
|
19
|
+
options[:range].first,
|
20
|
+
options[:range].last,
|
21
|
+
name
|
22
|
+
)
|
23
|
+
else
|
24
|
+
CustomHorizontalSlider.new(
|
25
|
+
app,
|
26
|
+
x,
|
27
|
+
y,
|
28
|
+
options[:length],
|
29
|
+
options[:range].first,
|
30
|
+
options[:range].last,
|
31
|
+
name
|
32
|
+
)
|
33
|
+
end
|
33
34
|
unless opts.empty?
|
34
35
|
slider.bar_width(opts.fetch(:bar_width, 10))
|
35
36
|
slider.set_value(opts.fetch(:initial_value, 0))
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
PHI ||= (1 + Math.sqrt(5)) / 2 # golden ratio
|
2
4
|
GA = PHI * 2 * Math::PI # golden angle
|
3
5
|
|
@@ -48,6 +50,7 @@ module VectorUtil
|
|
48
50
|
def self.cartesian_to_polar(vec:)
|
49
51
|
res = Vec3D.new(vec.mag, 0, 0)
|
50
52
|
return Vec3D.new unless res.x > 0
|
53
|
+
|
51
54
|
res.y = -Math.atan2(vec.z, vec.x)
|
52
55
|
res.z = Math.asin(vec.y / res.x)
|
53
56
|
res
|
@@ -64,6 +67,7 @@ module VectorUtil
|
|
64
67
|
|
65
68
|
def self.polar_to_cartesian(vec:)
|
66
69
|
return Vec3D.new if vec.mag <= 0
|
70
|
+
|
67
71
|
Vec3D.new(Math.asin(vec.y / vec.mag), vec.mag, -Math.atan2(vec.z, vec.x))
|
68
72
|
end
|
69
73
|
end
|
data/pom.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
+
project 'propane', 'https://github.com/monkstone/propane' do
|
3
4
|
model_version '4.0.0'
|
4
|
-
id 'propane:propane:3.
|
5
|
+
id 'propane:propane:3.7.1'
|
5
6
|
packaging 'jar'
|
6
7
|
|
7
8
|
description 'An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.'
|
@@ -33,49 +34,49 @@ project 'propane', 'https://github.com/monkstone/propane' do
|
|
33
34
|
|
34
35
|
issue_management 'https://github.com/ruby-processing/propane/issues', 'Github'
|
35
36
|
|
36
|
-
source_control(
|
37
|
-
:
|
38
|
-
:
|
37
|
+
source_control(url: 'https://github.com/ruby-processing/propane',
|
38
|
+
connection: 'scm:git:git://github.com/ruby-processing/propane.git',
|
39
|
+
developer_connection: 'scm:git:git@github.com/ruby-processing/propane.git')
|
39
40
|
|
40
|
-
properties(
|
41
|
+
properties('propane.basedir' => '${project.basedir}',
|
41
42
|
'processing.api' => 'http://processing.github.io/processing-javadocs/core/',
|
42
43
|
'source.directory' => 'src',
|
43
44
|
'polyglot.dump.pom' => 'pom.xml',
|
44
45
|
'project.build.sourceEncoding' => 'utf-8',
|
45
|
-
'jogl.version' => '2.3.2',
|
46
|
-
'jruby.api' => 'http://jruby.org/apidocs/'
|
46
|
+
'jogl.version' => '2.3.2', # for compiling actual included 2.4.0-rc
|
47
|
+
'jruby.api' => 'http://jruby.org/apidocs/')
|
47
48
|
|
48
|
-
|
49
|
-
jar 'org.processing:video:3.3.7'
|
49
|
+
pom 'org.jruby:jruby:9.2.15.0'
|
50
|
+
jar 'org.processing:video:3.3.7' # only for compiling
|
50
51
|
jar 'org.jogamp.jogl:jogl-all:${jogl.version}'
|
51
52
|
jar 'org.jogamp.gluegen:gluegen-rt-main:${jogl.version}'
|
52
53
|
|
53
54
|
overrides do
|
54
|
-
plugin(
|
55
|
-
'generateBackupPoms' =>
|
56
|
-
plugin(
|
57
|
-
'release' =>
|
58
|
-
plugin(
|
59
|
-
'detectOfflineLinks' =>
|
60
|
-
'links' => [
|
61
|
-
'${processing.api}'
|
62
|
-
plugin(
|
63
|
-
:jar, '3.1.2',
|
55
|
+
plugin('org.codehaus.mojo:versions-maven-plugin:2.7',
|
56
|
+
'generateBackupPoms' => 'false')
|
57
|
+
plugin(:compiler, '3.8.1',
|
58
|
+
'release' => '11')
|
59
|
+
plugin(:javadoc, '3.2.0',
|
60
|
+
'detectOfflineLinks' => 'false',
|
61
|
+
'links' => ['${jruby.api}',
|
62
|
+
'${processing.api}'])
|
63
|
+
plugin(:jar, '3.2.0',
|
64
64
|
'archive' => {
|
65
|
-
'manifestEntries' => {
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
65
|
+
'manifestEntries' => {
|
66
|
+
'Automatic-Module-Name' => 'processing.core'
|
67
|
+
}
|
68
|
+
})
|
69
|
+
end
|
70
|
+
build do
|
71
|
+
resource do
|
72
|
+
directory '${source.directory}/main/java'
|
73
|
+
includes '**/**/*.glsl', '**/*.jnilib'
|
74
|
+
excludes '**/**/*.java'
|
75
|
+
end
|
76
|
+
resource do
|
77
|
+
directory '${source.directory}/main/resources'
|
78
|
+
includes '**/*.png', '*.txt'
|
79
|
+
excludes
|
80
|
+
end
|
81
|
+
end
|
79
82
|
end
|
80
|
-
end
|
81
|
-
end
|