Skip to content

Commit 025d0df

Browse files
committed
updata pixel flow
1 parent 9b2261a commit 025d0df

File tree

9 files changed

+1261
-411
lines changed

9 files changed

+1261
-411
lines changed

external_library/java/PixelFlow/anti_aliasing.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ def setup
9999
end
100100

101101
def draw
102-
resize_screen
103102
case aamode
104103
when :MSAA
105104
display_scene_wrap(pg_render_msaa)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"/iterations": {
3+
"min": 0,
4+
"max": 80,
5+
"value": 40
6+
},
7+
"/vorticity": {
8+
"min": 0,
9+
"max": 1,
10+
"value": 0.10000000149011612
11+
},
12+
"/timestep": {
13+
"min": 0,
14+
"max": 1,
15+
"value": 0.125
16+
},
17+
"/gridscale": {
18+
"min": 0,
19+
"max": 50,
20+
"value": 1
21+
},
22+
"/background": {
23+
"min": 0,
24+
"max": 255,
25+
"value": 0
26+
},
27+
"/display_velocity_vectors": {"arrayValue": [1]},
28+
"/density": {
29+
"min": 0,
30+
"max": 1,
31+
"value": 0.9900000095367432
32+
},
33+
"/velocity": {
34+
"min": 0,
35+
"max": 1,
36+
"value": 0.5799999833106995
37+
},
38+
"/display_mode": {"arrayValue": [
39+
0,
40+
0,
41+
0,
42+
1
43+
]},
44+
"/temperature": {
45+
"min": 0,
46+
"max": 1,
47+
"value": 0.800000011920929
48+
}
49+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"/iterations": {
3+
"min": 0,
4+
"max": 80,
5+
"value": 40
6+
},
7+
"/vorticity": {
8+
"min": 0,
9+
"max": 1,
10+
"value": 0
11+
},
12+
"/BACKGROUND": {
13+
"min": 0,
14+
"max": 255,
15+
"value": 255
16+
},
17+
"/timestep": {
18+
"min": 0,
19+
"max": 1,
20+
"value": 0.125
21+
},
22+
"/fluid_displayParticles": {"arrayValue": [0]},
23+
"/gridscale": {
24+
"min": 0,
25+
"max": 50,
26+
"value": 1
27+
},
28+
"/fluid_displayMode": {"arrayValue": [
29+
1,
30+
0,
31+
0,
32+
0
33+
]},
34+
"/density": {
35+
"min": 0,
36+
"max": 1,
37+
"value": 0.9900000095367432
38+
},
39+
"/velocity": {
40+
"min": 0,
41+
"max": 1,
42+
"value": 0.5099999904632568
43+
},
44+
"/fluid_displayVelocityVectors": {"arrayValue": [0]},
45+
"/temperature": {
46+
"min": 0,
47+
"max": 1,
48+
"value": 0.5
49+
}
50+
}

external_library/java/PixelFlow/fluid_basic.rb

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# PixelFlow | Copyright (C) 2016-17 Thomas Diewald (www.thomasdiewald.com)
3-
# Translated to propane by Martin Prout
3+
# Translated to JRubyArt by Martin Prout
44
#
55
# src - www.github.com/diwi/PixelFlow
66
#
@@ -64,9 +64,6 @@ def setup
6464
context.print
6565
context.printGL
6666
@fluidgrid_scale = 1
67-
@GUI_W = 200
68-
@GUI_X = 20
69-
@GUI_Y = 20
7067

7168
# fluid simulation
7269
@fluid = DwFluid2D.new(context, VIEWPORT_W, VIEWPORT_H, fluidgrid_scale)
@@ -365,26 +362,26 @@ def createGUI
365362

366363
def controlEvent(event)
367364
if event.group?
368-
display_mode(rb_setdisplay_mode.get_value) if event.get_group.get_name == 'display_mode'
369-
display_velocity_vectors(event.get_group.get_value) if event.get_group.get_name == 'display_velocity_vectors'
365+
display_mode(rb_setdisplay_mode.value) if event.group.get_name == 'display_mode'
366+
display_velocity_vectors(event.group.value) if event.group.get_name == 'display_velocity_vectors'
370367
elsif event.controller?
371-
case event.get_controller.get_name
368+
case event.controller.get_name
372369
when 'gridscale'
373-
@fluidgrid_scale = event.get_controller.get_value.to_i
370+
@fluidgrid_scale = event.controller.value.to_i
374371
when 'velocity'
375-
fluid.param.dissipation_velocity = event.get_controller.get_value
372+
fluid.param.dissipation_velocity = event.controller.value
376373
when 'background'
377-
@background_color = event.get_controller.get_value
374+
@background_color = event.controller.value
378375
when 'temperature'
379-
fluid.param.dissipation_temperature = event.get_controller.get_value
376+
fluid.param.dissipation_temperature = event.controller.value
380377
when 'timestep'
381-
fluid.param.timestep = event.get_controller.get_value
378+
fluid.param.timestep = event.controller.value
382379
when 'iterations'
383-
fluid.param.num_jacobi_projection = event.get_controller.get_value
380+
fluid.param.num_jacobi_projection = event.controller.value
384381
when 'density'
385-
fluid.param.dissipation_density = event.get_controller.get_value
382+
fluid.param.dissipation_density = event.controller.value
386383
when 'vorticity'
387-
fluid.param.vorticity = event.get_controller.get_value
384+
fluid.param.vorticity = event.controller.value
388385
end
389386
end
390387
end

0 commit comments

Comments
 (0)