2023-12-31 14:09:49 +01:00
|
|
|
function Node_FLIP_Wall(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|
|
|
name = "Wall";
|
|
|
|
color = COLORS.node_blend_fluid;
|
|
|
|
icon = THEME.fluid_sim;
|
2024-03-28 14:18:02 +01:00
|
|
|
setDimension(96, 96);
|
2023-12-31 14:09:49 +01:00
|
|
|
|
|
|
|
manual_ungroupable = false;
|
|
|
|
|
2024-08-18 09:13:41 +02:00
|
|
|
newInput(0, nodeValue_Fdomain("Domain", self, noone ))
|
2023-12-31 14:09:49 +01:00
|
|
|
.setVisible(true, true);
|
|
|
|
|
2024-08-18 06:16:20 +02:00
|
|
|
newInput(1, nodeValue_Area("Area", self, DEF_AREA , { useShape : false }));
|
2023-12-31 14:09:49 +01:00
|
|
|
|
|
|
|
input_display_list = [ 0,
|
|
|
|
["Collider", false], 1
|
|
|
|
]
|
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
outputs[0] = nodeValue_Output("Domain", self, VALUE_TYPE.fdomain, noone );
|
2023-12-31 14:09:49 +01:00
|
|
|
|
|
|
|
obstracle = new FLIP_Obstracle();
|
|
|
|
|
2024-07-17 07:43:47 +02:00
|
|
|
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
2024-08-08 06:57:51 +02:00
|
|
|
if(inputs[1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
2024-07-17 07:43:47 +02:00
|
|
|
}
|
2023-12-31 14:09:49 +01:00
|
|
|
|
2024-07-17 07:43:47 +02:00
|
|
|
static update = function(frame = CURRENT_FRAME) {
|
2023-12-31 14:09:49 +01:00
|
|
|
var domain = getInputData(0);
|
2024-07-17 07:43:47 +02:00
|
|
|
var _area = getInputData(1);
|
2023-12-31 14:09:49 +01:00
|
|
|
if(!instance_exists(domain)) return;
|
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
outputs[0].setValue(domain);
|
2024-07-17 07:43:47 +02:00
|
|
|
FLIP_setSolid_rectangle(domain.domain, _area[0], _area[1], _area[2], _area[3]);
|
|
|
|
}
|
2023-12-31 14:09:49 +01:00
|
|
|
|
|
|
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
|
|
|
var bbox = drawGetBbox(xx, yy, _s);
|
2024-07-17 07:43:47 +02:00
|
|
|
draw_sprite_bbox_uniform(s_node_fluidSim_wall, 0, bbox);
|
2023-12-31 14:09:49 +01:00
|
|
|
}
|
|
|
|
}
|