mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 19:38:05 +01:00
VFX, globalvar reorder, line optim
This commit is contained in:
parent
900c1dea19
commit
ff5124b551
41 changed files with 553 additions and 228 deletions
|
@ -87,6 +87,7 @@
|
||||||
{"name":"d3d light","order":14,"path":"folders/nodes/data/3D/d3d light.yy",},
|
{"name":"d3d light","order":14,"path":"folders/nodes/data/3D/d3d light.yy",},
|
||||||
{"name":"d3d mesh","order":12,"path":"folders/nodes/data/3D/d3d mesh.yy",},
|
{"name":"d3d mesh","order":12,"path":"folders/nodes/data/3D/d3d mesh.yy",},
|
||||||
{"name":"d3d modifier","order":18,"path":"folders/nodes/data/3D/d3d modifier.yy",},
|
{"name":"d3d modifier","order":18,"path":"folders/nodes/data/3D/d3d modifier.yy",},
|
||||||
|
{"name":"d3d particle","order":19,"path":"folders/nodes/data/3D/d3d particle.yy",},
|
||||||
{"name":"animation","order":6,"path":"folders/nodes/data/animation.yy",},
|
{"name":"animation","order":6,"path":"folders/nodes/data/animation.yy",},
|
||||||
{"name":"compose","order":11,"path":"folders/nodes/data/compose.yy",},
|
{"name":"compose","order":11,"path":"folders/nodes/data/compose.yy",},
|
||||||
{"name":"armature","order":5,"path":"folders/nodes/data/compose/armature.yy",},
|
{"name":"armature","order":5,"path":"folders/nodes/data/compose/armature.yy",},
|
||||||
|
@ -127,7 +128,8 @@
|
||||||
{"name":"fluidSim","order":2,"path":"folders/nodes/data/simulation/fluidSim.yy",},
|
{"name":"fluidSim","order":2,"path":"folders/nodes/data/simulation/fluidSim.yy",},
|
||||||
{"name":"strandSim","order":1,"path":"folders/nodes/data/simulation/strandSim.yy",},
|
{"name":"strandSim","order":1,"path":"folders/nodes/data/simulation/strandSim.yy",},
|
||||||
{"name":"VFX","order":3,"path":"folders/nodes/data/simulation/VFX.yy",},
|
{"name":"VFX","order":3,"path":"folders/nodes/data/simulation/VFX.yy",},
|
||||||
{"name":"effector","order":9,"path":"folders/nodes/data/simulation/VFX/effector.yy",},
|
{"name":"affector","order":9,"path":"folders/nodes/data/simulation/VFX/affector.yy",},
|
||||||
|
{"name":"effects","order":11,"path":"folders/nodes/data/simulation/VFX/effects.yy",},
|
||||||
{"name":"transform","order":8,"path":"folders/nodes/data/transform.yy",},
|
{"name":"transform","order":8,"path":"folders/nodes/data/transform.yy",},
|
||||||
{"name":"value","order":4,"path":"folders/nodes/data/value.yy",},
|
{"name":"value","order":4,"path":"folders/nodes/data/value.yy",},
|
||||||
{"name":"array","order":1,"path":"folders/nodes/data/value/array.yy",},
|
{"name":"array","order":1,"path":"folders/nodes/data/value/array.yy",},
|
||||||
|
@ -220,7 +222,6 @@
|
||||||
{"name":"biterator","order":2,"path":"folders/VCT/biterator.yy",},
|
{"name":"biterator","order":2,"path":"folders/VCT/biterator.yy",},
|
||||||
{"name":"widget","order":3,"path":"folders/VCT/widget.yy",},
|
{"name":"widget","order":3,"path":"folders/VCT/widget.yy",},
|
||||||
{"name":"widgets","order":5,"path":"folders/widgets.yy",},
|
{"name":"widgets","order":5,"path":"folders/widgets.yy",},
|
||||||
{"name":"d3d particle","order":19,"path":"folders/nodes/data/3D/d3d particle.yy",},
|
|
||||||
],
|
],
|
||||||
"ResourceOrderSettings": [
|
"ResourceOrderSettings": [
|
||||||
{"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",},
|
{"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",},
|
||||||
|
@ -416,6 +417,7 @@
|
||||||
{"name":"s_biterator_b_grey_short","order":8,"path":"sprites/s_biterator_b_grey_short/s_biterator_b_grey_short.yy",},
|
{"name":"s_biterator_b_grey_short","order":8,"path":"sprites/s_biterator_b_grey_short/s_biterator_b_grey_short.yy",},
|
||||||
{"name":"printer","order":2,"path":"scripts/printer/printer.yy",},
|
{"name":"printer","order":2,"path":"scripts/printer/printer.yy",},
|
||||||
{"name":"sh_de_stray","order":16,"path":"shaders/sh_de_stray/sh_de_stray.yy",},
|
{"name":"sh_de_stray","order":16,"path":"shaders/sh_de_stray/sh_de_stray.yy",},
|
||||||
|
{"name":"s_node_vfx_osc","order":14,"path":"sprites/s_node_vfx_osc/s_node_vfx_osc.yy",},
|
||||||
{"name":"sh_chromatic_aberration","order":31,"path":"shaders/sh_chromatic_aberration/sh_chromatic_aberration.yy",},
|
{"name":"sh_chromatic_aberration","order":31,"path":"shaders/sh_chromatic_aberration/sh_chromatic_aberration.yy",},
|
||||||
{"name":"fd_rectangle_create_view","order":3,"path":"scripts/fd_rectangle_create_view/fd_rectangle_create_view.yy",},
|
{"name":"fd_rectangle_create_view","order":3,"path":"scripts/fd_rectangle_create_view/fd_rectangle_create_view.yy",},
|
||||||
{"name":"node_fluid_vortex","order":8,"path":"scripts/node_fluid_vortex/node_fluid_vortex.yy",},
|
{"name":"node_fluid_vortex","order":8,"path":"scripts/node_fluid_vortex/node_fluid_vortex.yy",},
|
||||||
|
@ -632,7 +634,6 @@
|
||||||
{"name":"pack_bottom_left","order":2,"path":"scripts/pack_bottom_left/pack_bottom_left.yy",},
|
{"name":"pack_bottom_left","order":2,"path":"scripts/pack_bottom_left/pack_bottom_left.yy",},
|
||||||
{"name":"o_dialog_lua_reference","order":5,"path":"objects/o_dialog_lua_reference/o_dialog_lua_reference.yy",},
|
{"name":"o_dialog_lua_reference","order":5,"path":"objects/o_dialog_lua_reference/o_dialog_lua_reference.yy",},
|
||||||
{"name":"__node_custom","order":14,"path":"scripts/__node_custom/__node_custom.yy",},
|
{"name":"__node_custom","order":14,"path":"scripts/__node_custom/__node_custom.yy",},
|
||||||
{"name":"node_VFX_trail_path","order":10,"path":"scripts/node_VFX_trail_path/node_VFX_trail_path.yy",},
|
|
||||||
{"name":"s_node_note","order":35,"path":"sprites/s_node_note/s_node_note.yy",},
|
{"name":"s_node_note","order":35,"path":"sprites/s_node_note/s_node_note.yy",},
|
||||||
{"name":"node_strand_gravity","order":4,"path":"scripts/node_strand_gravity/node_strand_gravity.yy",},
|
{"name":"node_strand_gravity","order":4,"path":"scripts/node_strand_gravity/node_strand_gravity.yy",},
|
||||||
{"name":"palette_functions","order":3,"path":"scripts/palette_functions/palette_functions.yy",},
|
{"name":"palette_functions","order":3,"path":"scripts/palette_functions/palette_functions.yy",},
|
||||||
|
@ -809,6 +810,7 @@
|
||||||
{"name":"node_perlin","order":8,"path":"scripts/node_perlin/node_perlin.yy",},
|
{"name":"node_perlin","order":8,"path":"scripts/node_perlin/node_perlin.yy",},
|
||||||
{"name":"node_blur_simple","order":4,"path":"scripts/node_blur_simple/node_blur_simple.yy",},
|
{"name":"node_blur_simple","order":4,"path":"scripts/node_blur_simple/node_blur_simple.yy",},
|
||||||
{"name":"node_feedback_input","order":1,"path":"scripts/node_feedback_input/node_feedback_input.yy",},
|
{"name":"node_feedback_input","order":1,"path":"scripts/node_feedback_input/node_feedback_input.yy",},
|
||||||
|
{"name":"s_node_vfx_trail","order":13,"path":"sprites/s_node_vfx_trail/s_node_vfx_trail.yy",},
|
||||||
{"name":"s_node_base_conversion","order":10,"path":"sprites/s_node_base_conversion/s_node_base_conversion.yy",},
|
{"name":"s_node_base_conversion","order":10,"path":"sprites/s_node_base_conversion/s_node_base_conversion.yy",},
|
||||||
{"name":"node_transform_array","order":15,"path":"scripts/node_transform_array/node_transform_array.yy",},
|
{"name":"node_transform_array","order":15,"path":"scripts/node_transform_array/node_transform_array.yy",},
|
||||||
{"name":"s_node_loop_array","order":23,"path":"sprites/s_node_loop_array/s_node_loop_array.yy",},
|
{"name":"s_node_loop_array","order":23,"path":"sprites/s_node_loop_array/s_node_loop_array.yy",},
|
||||||
|
@ -1021,6 +1023,7 @@
|
||||||
{"name":"s_node_vfx_spawn","order":2,"path":"sprites/s_node_vfx_spawn/s_node_vfx_spawn.yy",},
|
{"name":"s_node_vfx_spawn","order":2,"path":"sprites/s_node_vfx_spawn/s_node_vfx_spawn.yy",},
|
||||||
{"name":"__vec3","order":8,"path":"scripts/__vec3/__vec3.yy",},
|
{"name":"__vec3","order":8,"path":"scripts/__vec3/__vec3.yy",},
|
||||||
{"name":"texture_set_repeat","order":1,"path":"scripts/texture_set_repeat/texture_set_repeat.yy",},
|
{"name":"texture_set_repeat","order":1,"path":"scripts/texture_set_repeat/texture_set_repeat.yy",},
|
||||||
|
{"name":"node_VFX_effect_oscillate","order":9,"path":"scripts/node_VFX_effect_oscillate/node_VFX_effect_oscillate.yy",},
|
||||||
{"name":"o_dialog_color_quick_pick","order":5,"path":"objects/o_dialog_color_quick_pick/o_dialog_color_quick_pick.yy",},
|
{"name":"o_dialog_color_quick_pick","order":5,"path":"objects/o_dialog_color_quick_pick/o_dialog_color_quick_pick.yy",},
|
||||||
{"name":"fd_rectangle_update_velocity","order":22,"path":"scripts/fd_rectangle_update_velocity/fd_rectangle_update_velocity.yy",},
|
{"name":"fd_rectangle_update_velocity","order":22,"path":"scripts/fd_rectangle_update_velocity/fd_rectangle_update_velocity.yy",},
|
||||||
{"name":"sh_3d_extrude_filler_depth","order":9,"path":"shaders/sh_3d_extrude_filler_depth/sh_3d_extrude_filler_depth.yy",},
|
{"name":"sh_3d_extrude_filler_depth","order":9,"path":"shaders/sh_3d_extrude_filler_depth/sh_3d_extrude_filler_depth.yy",},
|
||||||
|
|
|
@ -111,6 +111,7 @@
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"d3d light","folderPath":"folders/nodes/data/3D/d3d light.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"d3d light","folderPath":"folders/nodes/data/3D/d3d light.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"d3d mesh","folderPath":"folders/nodes/data/3D/d3d mesh.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"d3d mesh","folderPath":"folders/nodes/data/3D/d3d mesh.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"d3d modifier","folderPath":"folders/nodes/data/3D/d3d modifier.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"d3d modifier","folderPath":"folders/nodes/data/3D/d3d modifier.yy",},
|
||||||
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"d3d particle","folderPath":"folders/nodes/data/3D/d3d particle.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"animation","folderPath":"folders/nodes/data/animation.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"animation","folderPath":"folders/nodes/data/animation.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"compose","folderPath":"folders/nodes/data/compose.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"compose","folderPath":"folders/nodes/data/compose.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"armature","folderPath":"folders/nodes/data/compose/armature.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"armature","folderPath":"folders/nodes/data/compose/armature.yy",},
|
||||||
|
@ -154,7 +155,8 @@
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"rigidSim","folderPath":"folders/nodes/data/simulation/rigidSim.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"rigidSim","folderPath":"folders/nodes/data/simulation/rigidSim.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"strandSim","folderPath":"folders/nodes/data/simulation/strandSim.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"strandSim","folderPath":"folders/nodes/data/simulation/strandSim.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"VFX","folderPath":"folders/nodes/data/simulation/VFX.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"VFX","folderPath":"folders/nodes/data/simulation/VFX.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"effector","folderPath":"folders/nodes/data/simulation/VFX/effector.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"affector","folderPath":"folders/nodes/data/simulation/VFX/affector.yy",},
|
||||||
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"effects","folderPath":"folders/nodes/data/simulation/VFX/effects.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"transform","folderPath":"folders/nodes/data/transform.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"transform","folderPath":"folders/nodes/data/transform.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"value","folderPath":"folders/nodes/data/value.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"value","folderPath":"folders/nodes/data/value.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"array","folderPath":"folders/nodes/data/value/array.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"array","folderPath":"folders/nodes/data/value/array.yy",},
|
||||||
|
@ -253,7 +255,6 @@
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"biterator","folderPath":"folders/VCT/biterator.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"biterator","folderPath":"folders/VCT/biterator.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widget","folderPath":"folders/VCT/widget.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widget","folderPath":"folders/VCT/widget.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",},
|
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",},
|
||||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"d3d particle","folderPath":"folders/nodes/data/3D/d3d particle.yy",},
|
|
||||||
],
|
],
|
||||||
"IncludedFiles": [
|
"IncludedFiles": [
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
|
||||||
|
@ -995,6 +996,7 @@
|
||||||
{"id":{"name":"printer","path":"scripts/printer/printer.yy",},},
|
{"id":{"name":"printer","path":"scripts/printer/printer.yy",},},
|
||||||
{"id":{"name":"node_iterate","path":"scripts/node_iterate/node_iterate.yy",},},
|
{"id":{"name":"node_iterate","path":"scripts/node_iterate/node_iterate.yy",},},
|
||||||
{"id":{"name":"sh_de_stray","path":"shaders/sh_de_stray/sh_de_stray.yy",},},
|
{"id":{"name":"sh_de_stray","path":"shaders/sh_de_stray/sh_de_stray.yy",},},
|
||||||
|
{"id":{"name":"s_node_vfx_osc","path":"sprites/s_node_vfx_osc/s_node_vfx_osc.yy",},},
|
||||||
{"id":{"name":"sh_chromatic_aberration","path":"shaders/sh_chromatic_aberration/sh_chromatic_aberration.yy",},},
|
{"id":{"name":"sh_chromatic_aberration","path":"shaders/sh_chromatic_aberration/sh_chromatic_aberration.yy",},},
|
||||||
{"id":{"name":"fd_rectangle_create_view","path":"scripts/fd_rectangle_create_view/fd_rectangle_create_view.yy",},},
|
{"id":{"name":"fd_rectangle_create_view","path":"scripts/fd_rectangle_create_view/fd_rectangle_create_view.yy",},},
|
||||||
{"id":{"name":"node_fluid_vortex","path":"scripts/node_fluid_vortex/node_fluid_vortex.yy",},},
|
{"id":{"name":"node_fluid_vortex","path":"scripts/node_fluid_vortex/node_fluid_vortex.yy",},},
|
||||||
|
@ -1450,6 +1452,7 @@
|
||||||
{"id":{"name":"node_perlin","path":"scripts/node_perlin/node_perlin.yy",},},
|
{"id":{"name":"node_perlin","path":"scripts/node_perlin/node_perlin.yy",},},
|
||||||
{"id":{"name":"node_blur_simple","path":"scripts/node_blur_simple/node_blur_simple.yy",},},
|
{"id":{"name":"node_blur_simple","path":"scripts/node_blur_simple/node_blur_simple.yy",},},
|
||||||
{"id":{"name":"node_feedback_input","path":"scripts/node_feedback_input/node_feedback_input.yy",},},
|
{"id":{"name":"node_feedback_input","path":"scripts/node_feedback_input/node_feedback_input.yy",},},
|
||||||
|
{"id":{"name":"s_node_vfx_trail","path":"sprites/s_node_vfx_trail/s_node_vfx_trail.yy",},},
|
||||||
{"id":{"name":"o_dialog_add_multiple_images","path":"objects/o_dialog_add_multiple_images/o_dialog_add_multiple_images.yy",},},
|
{"id":{"name":"o_dialog_add_multiple_images","path":"objects/o_dialog_add_multiple_images/o_dialog_add_multiple_images.yy",},},
|
||||||
{"id":{"name":"assets_data","path":"scripts/assets_data/assets_data.yy",},},
|
{"id":{"name":"assets_data","path":"scripts/assets_data/assets_data.yy",},},
|
||||||
{"id":{"name":"s_node_base_conversion","path":"sprites/s_node_base_conversion/s_node_base_conversion.yy",},},
|
{"id":{"name":"s_node_base_conversion","path":"sprites/s_node_base_conversion/s_node_base_conversion.yy",},},
|
||||||
|
@ -1686,6 +1689,7 @@
|
||||||
{"id":{"name":"s_node_vfx_spawn","path":"sprites/s_node_vfx_spawn/s_node_vfx_spawn.yy",},},
|
{"id":{"name":"s_node_vfx_spawn","path":"sprites/s_node_vfx_spawn/s_node_vfx_spawn.yy",},},
|
||||||
{"id":{"name":"__vec3","path":"scripts/__vec3/__vec3.yy",},},
|
{"id":{"name":"__vec3","path":"scripts/__vec3/__vec3.yy",},},
|
||||||
{"id":{"name":"texture_set_repeat","path":"scripts/texture_set_repeat/texture_set_repeat.yy",},},
|
{"id":{"name":"texture_set_repeat","path":"scripts/texture_set_repeat/texture_set_repeat.yy",},},
|
||||||
|
{"id":{"name":"node_VFX_effect_oscillate","path":"scripts/node_VFX_effect_oscillate/node_VFX_effect_oscillate.yy",},},
|
||||||
{"id":{"name":"o_dialog_color_quick_pick","path":"objects/o_dialog_color_quick_pick/o_dialog_color_quick_pick.yy",},},
|
{"id":{"name":"o_dialog_color_quick_pick","path":"objects/o_dialog_color_quick_pick/o_dialog_color_quick_pick.yy",},},
|
||||||
{"id":{"name":"fd_rectangle_update_velocity","path":"scripts/fd_rectangle_update_velocity/fd_rectangle_update_velocity.yy",},},
|
{"id":{"name":"fd_rectangle_update_velocity","path":"scripts/fd_rectangle_update_velocity/fd_rectangle_update_velocity.yy",},},
|
||||||
{"id":{"name":"sh_3d_extrude_filler_depth","path":"shaders/sh_3d_extrude_filler_depth/sh_3d_extrude_filler_depth.yy",},},
|
{"id":{"name":"sh_3d_extrude_filler_depth","path":"shaders/sh_3d_extrude_filler_depth/sh_3d_extrude_filler_depth.yy",},},
|
||||||
|
|
|
@ -70,6 +70,9 @@ function __part(_node) constructor {
|
||||||
ground_bounce = 0;
|
ground_bounce = 0;
|
||||||
ground_friction = 1;
|
ground_friction = 1;
|
||||||
|
|
||||||
|
trailLife = 0;
|
||||||
|
trailActive = false;
|
||||||
|
|
||||||
frame = 0;
|
frame = 0;
|
||||||
|
|
||||||
static reset = function() { #region
|
static reset = function() { #region
|
||||||
|
@ -89,13 +92,18 @@ function __part(_node) constructor {
|
||||||
x = _x;
|
x = _x;
|
||||||
y = _y;
|
y = _y;
|
||||||
|
|
||||||
|
drawx = x;
|
||||||
|
drawy = y;
|
||||||
|
|
||||||
life_incr = 0;
|
life_incr = 0;
|
||||||
life = _life;
|
life = _life;
|
||||||
life_total = life;
|
life_total = life;
|
||||||
if(node.onPartCreate != noone) node.onPartCreate(self);
|
if(node.onPartCreate != noone) node.onPartCreate(self);
|
||||||
|
|
||||||
x_history = array_create(life);
|
trailActive = true;
|
||||||
y_history = array_create(life);
|
trailLife = 0;
|
||||||
|
x_history = array_create(life);
|
||||||
|
y_history = array_create(life);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static setPhysic = function(_sx, _sy, _ac, _g, _gDir, _turn, _turnSpd) { #region
|
static setPhysic = function(_sx, _sy, _ac, _g, _gDir, _turn, _turnSpd) { #region
|
||||||
|
@ -168,6 +176,7 @@ function __part(_node) constructor {
|
||||||
|
|
||||||
static step = function(frame = 0) { #region
|
static step = function(frame = 0) { #region
|
||||||
gml_pragma("forceinline");
|
gml_pragma("forceinline");
|
||||||
|
trailLife++;
|
||||||
|
|
||||||
if(!active) return;
|
if(!active) return;
|
||||||
x += speedx;
|
x += speedx;
|
||||||
|
@ -206,10 +215,6 @@ function __part(_node) constructor {
|
||||||
if(node.onPartStep != noone && step_int > 0 && safe_mod(life, step_int) == 0)
|
if(node.onPartStep != noone && step_int > 0 && safe_mod(life, step_int) == 0)
|
||||||
node.onPartStep(self);
|
node.onPartStep(self);
|
||||||
|
|
||||||
x_history[life_incr] = x;
|
|
||||||
y_history[life_incr] = y;
|
|
||||||
|
|
||||||
life_incr++;
|
|
||||||
if(life-- < 0) kill();
|
if(life-- < 0) kill();
|
||||||
|
|
||||||
if(prevx != undefined) {
|
if(prevx != undefined) {
|
||||||
|
@ -217,6 +222,10 @@ function __part(_node) constructor {
|
||||||
spVec[1] = point_direction(prevx, prevy, x, y);
|
spVec[1] = point_direction(prevx, prevy, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
x_history[life_incr] = drawx;
|
||||||
|
y_history[life_incr] = drawy;
|
||||||
|
life_incr++;
|
||||||
|
|
||||||
prevx = x;
|
prevx = x;
|
||||||
prevy = y;
|
prevy = y;
|
||||||
|
|
||||||
|
@ -255,7 +264,8 @@ function __part(_node) constructor {
|
||||||
//print($"Drawing part destroy when animation end");
|
//print($"Drawing part destroy when animation end");
|
||||||
kill();
|
kill();
|
||||||
return;
|
return;
|
||||||
} else ss = surf[ind];
|
} else
|
||||||
|
ss = surf[ind];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -428,7 +428,6 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
|
|
||||||
//var activeParts = 0;
|
//var activeParts = 0;
|
||||||
for(var i = 0; i < array_length(parts); i++) {
|
for(var i = 0; i < array_length(parts); i++) {
|
||||||
if(!parts[i].active) continue;
|
|
||||||
//activeParts++;
|
//activeParts++;
|
||||||
parts[i].step(_time);
|
parts[i].step(_time);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
function globalvar_viewer_init() {
|
function globalvar_viewer_init() {
|
||||||
var_editing = false;
|
var_editing = false;
|
||||||
|
|
||||||
|
var_dragging = noone;
|
||||||
|
var_drag_insert = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry) {
|
function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry) {
|
||||||
|
@ -7,9 +10,11 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry
|
||||||
var lb_h = line_get_height(f_p0) + ui(8);
|
var lb_h = line_get_height(f_p0) + ui(8);
|
||||||
var padd = ui(8);
|
var padd = ui(8);
|
||||||
|
|
||||||
|
var _node = PROJECT.globalNode;
|
||||||
|
|
||||||
if(var_editing) {
|
if(var_editing) {
|
||||||
var del = noone;
|
var del = noone;
|
||||||
if(ds_list_size(PROJECT.globalNode.inputs)) {
|
if(ds_list_size(_node.inputs)) {
|
||||||
yy += ui(8);
|
yy += ui(8);
|
||||||
hh += ui(8);
|
hh += ui(8);
|
||||||
}
|
}
|
||||||
|
@ -17,12 +22,30 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry
|
||||||
var wd_x = xx;
|
var wd_x = xx;
|
||||||
var wd_w = ww;
|
var wd_w = ww;
|
||||||
|
|
||||||
for( var j = 0; j < ds_list_size(PROJECT.globalNode.inputs); j++ ) {
|
var _len = ds_list_size(_node.inputs);
|
||||||
var _inpu = PROJECT.globalNode.inputs[| j];
|
var _ins = var_drag_insert;
|
||||||
|
var_drag_insert = _len;
|
||||||
|
|
||||||
|
for( var j = 0; j < _len; j++ ) {
|
||||||
|
var _inpu = _node.inputs[| j];
|
||||||
var _edit = _inpu.editor;
|
var _edit = _inpu.editor;
|
||||||
var wd_h = ui(32);
|
var wd_h = ui(32);
|
||||||
|
|
||||||
if(j) {
|
if(var_dragging != noone) {
|
||||||
|
if(_m[1] < yy + wd_h && var_drag_insert == _len)
|
||||||
|
var_drag_insert = j;
|
||||||
|
|
||||||
|
if(j == _ins) {
|
||||||
|
draw_set_color(COLORS._main_icon);
|
||||||
|
draw_line_round(wd_x + ui(8), yy, wd_x + wd_w - ui(16), yy, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(var_dragging == j)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
yy += ui(10);
|
||||||
|
hh += ui(10);
|
||||||
|
} else if(j) {
|
||||||
draw_set_color(merge_color(c_black, COLORS.panel_toolbar_separator, 0.75));
|
draw_set_color(merge_color(c_black, COLORS.panel_toolbar_separator, 0.75));
|
||||||
draw_line_round(wd_x + ui(8), yy, wd_x + wd_w - ui(16), yy, 4);
|
draw_line_round(wd_x + ui(8), yy, wd_x + wd_w - ui(16), yy, 4);
|
||||||
|
|
||||||
|
@ -30,12 +53,25 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry
|
||||||
hh += ui(10);
|
hh += ui(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var bx = wd_x + ui(10);
|
||||||
|
var by = yy + ui(16);
|
||||||
|
if(hover && point_in_rectangle(_m[0], _m[1], bx - ui(12), by - ui(12), bx + ui(12), by + ui(12))) {
|
||||||
|
draw_sprite_stretched_ext(THEME.group_label, 0, bx - ui(12), by - ui(12), ui(24), ui(24), COLORS._main_icon_light, 1);
|
||||||
|
|
||||||
|
if(mouse_press(mb_left, focus)) {
|
||||||
|
var_dragging = j;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
draw_sprite_stretched_ext(THEME.group_label, 0, bx - ui(12), by - ui(12), ui(24), ui(24), COLORS._main_icon_light, 0.75);
|
||||||
|
|
||||||
|
draw_sprite_ext(THEME.hamburger, 0, bx, by, 0.5, 0.5, 0, COLORS._main_icon_light, 1);
|
||||||
|
|
||||||
_edit.tb_name.setFocusHover(focus, hover);
|
_edit.tb_name.setFocusHover(focus, hover);
|
||||||
_edit.sc_type.setFocusHover(focus, hover);
|
_edit.sc_type.setFocusHover(focus, hover);
|
||||||
_edit.sc_disp.setFocusHover(focus, hover);
|
_edit.sc_disp.setFocusHover(focus, hover);
|
||||||
|
|
||||||
_edit.tb_name.draw(wd_x, yy, wd_w - wd_h - ui(4), wd_h, _inpu.name, _m, TEXTBOX_INPUT.text);
|
_edit.tb_name.draw(wd_x + ui(32), yy, wd_w - wd_h - ui(32 + 4), wd_h, _inpu.name, _m, TEXTBOX_INPUT.text);
|
||||||
if(buttonInstant(THEME.button_hide, wd_x + wd_w - wd_h, yy + ui(2), wd_h, wd_h, _m, focus, hover,, THEME.icon_delete,, COLORS._main_value_negative) == 2)
|
if(buttonInstant(THEME.button_hide, wd_x + wd_w - wd_h, yy, wd_h, wd_h, _m, focus, hover,, THEME.icon_delete,, COLORS._main_value_negative) == 2)
|
||||||
del = j;
|
del = j;
|
||||||
yy += wd_h + ui(8);
|
yy += wd_h + ui(8);
|
||||||
hh += wd_h + ui(8);
|
hh += wd_h + ui(8);
|
||||||
|
@ -52,16 +88,36 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry
|
||||||
hh += wd_h + ui(4);
|
hh += wd_h + ui(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(var_dragging != noone) {
|
||||||
|
if(var_drag_insert == _len) {
|
||||||
|
draw_set_color(COLORS._main_icon);
|
||||||
|
draw_line_round(wd_x + ui(8), yy, wd_x + wd_w - ui(16), yy, 4);
|
||||||
|
|
||||||
|
yy += ui(10);
|
||||||
|
hh += ui(10);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mouse_release(mb_left)) {
|
||||||
|
var _inp = _node.inputs[| var_dragging];
|
||||||
|
ds_list_delete(_node.inputs, var_dragging);
|
||||||
|
|
||||||
|
if(var_drag_insert > var_dragging) var_drag_insert--;
|
||||||
|
ds_list_insert(_node.inputs, var_drag_insert, _inp);
|
||||||
|
|
||||||
|
var_dragging = noone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(del != noone)
|
if(del != noone)
|
||||||
ds_list_delete(PROJECT.globalNode.inputs, del);
|
ds_list_delete(_node.inputs, del);
|
||||||
} else {
|
} else {
|
||||||
for( var j = 0; j < ds_list_size(PROJECT.globalNode.inputs); j++ ) {
|
for( var j = 0; j < ds_list_size(_node.inputs); j++ ) {
|
||||||
var widg = drawWidget(xx, yy, ww, _m, PROJECT.globalNode.inputs[| j], true, focus, hover, _scrollPane, rx, ry);
|
var widg = drawWidget(xx, yy, ww, _m, _node.inputs[| j], true, focus, hover, _scrollPane, rx, ry);
|
||||||
var widH = widg[0];
|
var widH = widg[0];
|
||||||
var mbRight = widg[1];
|
var mbRight = widg[1];
|
||||||
|
|
||||||
if(hover && point_in_rectangle(_m[0], _m[1], xx, yy, xx + ww, yy + widH))
|
if(hover && point_in_rectangle(_m[0], _m[1], xx, yy, xx + ww, yy + widH))
|
||||||
_HOVERING_ELEMENT = PROJECT.globalNode.inputs[| j];
|
_HOVERING_ELEMENT = _node.inputs[| j];
|
||||||
|
|
||||||
yy += lb_h + widH + padd;
|
yy += lb_h + widH + padd;
|
||||||
hh += lb_h + widH + padd;
|
hh += lb_h + widH + padd;
|
||||||
|
|
|
@ -10,8 +10,8 @@ function Node_VFX_Accelerate(_x, _y, _group = noone) : Node_VFX_effector(_x, _y,
|
||||||
var _rot = random_range(_rot_range[0], _rot_range[1]);
|
var _rot = random_range(_rot_range[0], _rot_range[1]);
|
||||||
var _sca = [ random_range(_sca_range[0], _sca_range[1]), random_range(_sca_range[2], _sca_range[3]) ];
|
var _sca = [ random_range(_sca_range[0], _sca_range[1]), random_range(_sca_range[2], _sca_range[3]) ];
|
||||||
|
|
||||||
part.sx = part.sx + _vect[0] * str * _sten;
|
part.speedx = part.speedx + _vect[0] * str * _sten;
|
||||||
part.sy = part.sy + _vect[1] * str * _sten;
|
part.speedy = part.speedy + _vect[1] * str * _sten;
|
||||||
|
|
||||||
part.rot += _rot * str;
|
part.rot += _rot * str;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "effector",
|
"name": "affector",
|
||||||
"path": "folders/nodes/data/simulation/VFX/effector.yy",
|
"path": "folders/nodes/data/simulation/VFX/affector.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -4,6 +4,10 @@ function Node_VFX_Attract(_x, _y, _group = noone) : Node_VFX_effector(_x, _y, _g
|
||||||
|
|
||||||
inputs[| 4].setVisible(false, false);
|
inputs[| 4].setVisible(false, false);
|
||||||
|
|
||||||
|
inputs[| effector_input_length + 0] = nodeValue("Destroy when reach middle", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false );
|
||||||
|
|
||||||
|
array_push(input_display_list, effector_input_length + 0);
|
||||||
|
|
||||||
function onAffect(part, str) {
|
function onAffect(part, str) {
|
||||||
var _area = getInputData(1);
|
var _area = getInputData(1);
|
||||||
var _area_x = _area[0];
|
var _area_x = _area[0];
|
||||||
|
@ -15,6 +19,8 @@ function Node_VFX_Attract(_x, _y, _group = noone) : Node_VFX_effector(_x, _y, _g
|
||||||
var _rot = random_range(_rot_range[0], _rot_range[1]);
|
var _rot = random_range(_rot_range[0], _rot_range[1]);
|
||||||
var _sca = [ random_range(_sca_range[0], _sca_range[1]), random_range(_sca_range[2], _sca_range[3]) ];
|
var _sca = [ random_range(_sca_range[0], _sca_range[1]), random_range(_sca_range[2], _sca_range[3]) ];
|
||||||
|
|
||||||
|
var _dest = getInputData(effector_input_length + 2);
|
||||||
|
|
||||||
var pv = part.getPivot();
|
var pv = part.getPivot();
|
||||||
var dirr = point_direction(pv[0], pv[1], _area_x, _area_y);
|
var dirr = point_direction(pv[0], pv[1], _area_x, _area_y);
|
||||||
part.x = part.x + lengthdir_x(_sten * str, dirr);
|
part.x = part.x + lengthdir_x(_sten * str, dirr);
|
||||||
|
@ -29,6 +35,9 @@ function Node_VFX_Attract(_x, _y, _group = noone) : Node_VFX_effector(_x, _y, _g
|
||||||
else part.sc_sx += sign(part.sc_sx) * scx_s;
|
else part.sc_sx += sign(part.sc_sx) * scx_s;
|
||||||
if(scy_s < 0) part.sc_sy = lerp_linear(part.sc_sy, 0, abs(scy_s));
|
if(scy_s < 0) part.sc_sy = lerp_linear(part.sc_sy, 0, abs(scy_s));
|
||||||
else part.sc_sy += sign(part.sc_sy) * scy_s;
|
else part.sc_sy += sign(part.sc_sy) * scy_s;
|
||||||
|
|
||||||
|
if(_dest && point_distance(part.x, part.y, _area_x, _area_y) <= _sten)
|
||||||
|
part.kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
PATCH_STATIC
|
PATCH_STATIC
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "effector",
|
"name": "affector",
|
||||||
"path": "folders/nodes/data/simulation/VFX/effector.yy",
|
"path": "folders/nodes/data/simulation/VFX/affector.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "effector",
|
"name": "affector",
|
||||||
"path": "folders/nodes/data/simulation/VFX/effector.yy",
|
"path": "folders/nodes/data/simulation/VFX/affector.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
function Node_VFX_Oscillate(_x, _y, _group = noone) : Node_VFX_effector(_x, _y, _group) constructor {
|
||||||
|
name = "Oscillate";
|
||||||
|
node_draw_icon = s_node_vfx_osc;
|
||||||
|
|
||||||
|
inputs[| 4].setVisible(false, false);
|
||||||
|
inputs[| 6].setVisible(false, false);
|
||||||
|
inputs[| 7].setVisible(false, false);
|
||||||
|
|
||||||
|
inputs[| effector_input_length + 0] = nodeValue("Amplitude", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 2 );
|
||||||
|
|
||||||
|
inputs[| effector_input_length + 1] = nodeValue("Frequency", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.2 );
|
||||||
|
|
||||||
|
inputs[| effector_input_length + 2] = nodeValue("Multiply by speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false );
|
||||||
|
|
||||||
|
array_push(input_display_list, effector_input_length + 0, effector_input_length + 1, effector_input_length + 2);
|
||||||
|
|
||||||
|
function onAffect(part, str) {
|
||||||
|
var _sten = getInputData(5);
|
||||||
|
|
||||||
|
var _amp = getInputData(effector_input_length + 0);
|
||||||
|
var _fre = getInputData(effector_input_length + 1);
|
||||||
|
var _mls = getInputData(effector_input_length + 2);
|
||||||
|
|
||||||
|
var _lif = part.life;
|
||||||
|
var _dir = part.spVec[1] + 90;
|
||||||
|
|
||||||
|
var _aamp = sin(part.seed + _lif * _fre) * _amp;
|
||||||
|
if(_mls) _aamp *= part.spVec[0];
|
||||||
|
|
||||||
|
var _dx = lengthdir_x(_aamp, _dir);
|
||||||
|
var _dy = lengthdir_y(_aamp, _dir);
|
||||||
|
|
||||||
|
part.drawx += _dx;
|
||||||
|
part.drawy += _dy;
|
||||||
|
}
|
||||||
|
|
||||||
|
PATCH_STATIC
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "node_VFX_effect_oscillate",
|
||||||
|
"isCompatibility": false,
|
||||||
|
"isDnD": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "affector",
|
||||||
|
"path": "folders/nodes/data/simulation/VFX/affector.yy",
|
||||||
|
},
|
||||||
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "effector",
|
"name": "affector",
|
||||||
"path": "folders/nodes/data/simulation/VFX/effector.yy",
|
"path": "folders/nodes/data/simulation/VFX/affector.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "effector",
|
"name": "affector",
|
||||||
"path": "folders/nodes/data/simulation/VFX/effector.yy",
|
"path": "folders/nodes/data/simulation/VFX/affector.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "effector",
|
"name": "affector",
|
||||||
"path": "folders/nodes/data/simulation/VFX/effector.yy",
|
"path": "folders/nodes/data/simulation/VFX/affector.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "effector",
|
"name": "affector",
|
||||||
"path": "folders/nodes/data/simulation/VFX/effector.yy",
|
"path": "folders/nodes/data/simulation/VFX/affector.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -9,10 +9,12 @@ enum FORCE_TYPE {
|
||||||
}
|
}
|
||||||
|
|
||||||
function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
name = "Effector";
|
name = "Effector";
|
||||||
color = COLORS.node_blend_vfx;
|
color = COLORS.node_blend_vfx;
|
||||||
icon = THEME.vfx;
|
icon = THEME.vfx;
|
||||||
previewable = false;
|
reloop = true;
|
||||||
|
|
||||||
|
previewable = false;
|
||||||
node_draw_icon = s_node_vfx_accel;
|
node_draw_icon = s_node_vfx_accel;
|
||||||
|
|
||||||
w = 96;
|
w = 96;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "effector",
|
"name": "affector",
|
||||||
"path": "folders/nodes/data/simulation/VFX/effector.yy",
|
"path": "folders/nodes/data/simulation/VFX/affector.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -1,7 +1,8 @@
|
||||||
function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _group) constructor {
|
function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _group) constructor {
|
||||||
name = "Spawner";
|
name = "Spawner";
|
||||||
color = COLORS.node_blend_vfx;
|
color = COLORS.node_blend_vfx;
|
||||||
icon = THEME.vfx;
|
icon = THEME.vfx;
|
||||||
|
reloop = true;
|
||||||
|
|
||||||
attributes.Output_pool = false;
|
attributes.Output_pool = false;
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,20 @@
|
||||||
function Node_VXF_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
function Node_VFX_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
name = "Trail Path";
|
name = "VFX Trail";
|
||||||
previewable = false;
|
previewable = false;
|
||||||
|
|
||||||
w = 96;
|
w = 96;
|
||||||
length = [];
|
length = [];
|
||||||
lengthAcc = [];
|
lengthAcc = [];
|
||||||
|
lines = [];
|
||||||
|
lineLength = [];
|
||||||
|
lineData = [];
|
||||||
|
|
||||||
lines = [];
|
inputs[| 0] = nodeValue("Particles", self, JUNCTION_CONNECT.input, VALUE_TYPE.particle, -1 )
|
||||||
|
.setVisible(true, true);
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Point array", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [])
|
inputs[| 1] = nodeValue("Life", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 4 );
|
||||||
.setVisible(true, true)
|
|
||||||
.setArrayDepth(2);
|
inputs[| 2] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false );
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.output, VALUE_TYPE.pathnode, self);
|
outputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.output, VALUE_TYPE.pathnode, self);
|
||||||
|
|
||||||
|
@ -35,26 +39,29 @@ function Node_VXF_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
static getLength = function(index) { return array_safe_get(length, index); }
|
static getLength = function(index) { return array_safe_get(length, index); }
|
||||||
static getAccuLength = function(index) { return array_safe_get(lengthAcc, index, []); }
|
static getAccuLength = function(index) { return array_safe_get(lengthAcc, index, []); }
|
||||||
|
|
||||||
static getPointRatio = function(_rat, _ind = 0) { #region
|
static getPointRatio = function(_rat, _ind = 0, out = undefined) { #region
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
|
|
||||||
var _p0, _p1;
|
var _p0, _p1;
|
||||||
var _x, _y;
|
var _x, _y;
|
||||||
|
|
||||||
var line = array_safe_get(lines, _ind, []);
|
var line = lines[_ind];
|
||||||
|
var _st = _rat * (lineLength[_ind] - 1);
|
||||||
|
_p0 = line[floor(_st) + 0];
|
||||||
|
_p1 = line[floor(_st) + 1];
|
||||||
|
|
||||||
var _st = _rat * (array_length(line) - 1);
|
if(!is_array(_p0)) return out;
|
||||||
_p0 = array_safe_get(line, floor(_st) + 0);
|
if(!is_array(_p1)) return out;
|
||||||
_p1 = array_safe_get(line, floor(_st) + 1);
|
|
||||||
|
|
||||||
if(!is_array(_p0)) return new __vec2();
|
out.x = lerp(_p0[0], _p1[0], frac(_st));
|
||||||
if(!is_array(_p1)) return new __vec2();
|
out.y = lerp(_p0[1], _p1[1], frac(_st));
|
||||||
|
|
||||||
_x = lerp(_p0[0], _p1[0], frac(_st));
|
return out;
|
||||||
_y = lerp(_p0[1], _p1[1], frac(_st));
|
|
||||||
|
|
||||||
return new __vec2( _x, _y );
|
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getPointDistance = function(_dist, ind = 0) { return getPointRatio(_dist / length[ind], ind); }
|
static getPointDistance = function(_dist, ind = 0, out = undefined) { return getPointRatio(_dist / length[ind], ind, out); }
|
||||||
|
|
||||||
|
static getPathData = function() { return lineData; }
|
||||||
|
|
||||||
static getBoundary = function() { #region
|
static getBoundary = function() { #region
|
||||||
var boundary = new BoundingBox();
|
var boundary = new BoundingBox();
|
||||||
|
@ -69,46 +76,64 @@ function Node_VXF_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static update = function() { #region
|
static update = function() { #region
|
||||||
var _lines = getInputData(0);
|
var _vfxs = getInputData(0);
|
||||||
if(array_empty(_lines)) return;
|
if(array_empty(_vfxs) || !is_array(_vfxs)) return;
|
||||||
|
|
||||||
lines = _lines;
|
var _life = getInputData(1); _life = max(_life, 1);
|
||||||
if(!is_array(_lines[0][0]))
|
var _colr = getInputData(2);
|
||||||
lines = [ lines ];
|
|
||||||
|
|
||||||
var _len = array_length(lines);
|
lines = [];
|
||||||
length = array_create(_len);
|
length = [];
|
||||||
lengthAcc = array_create(_len);
|
lengthAcc = [];
|
||||||
|
lineLength = [];
|
||||||
|
lineData = [];
|
||||||
|
|
||||||
|
for( var i = 0; i < array_length(_vfxs); i++ ) {
|
||||||
|
var _vfx = _vfxs[i];
|
||||||
|
|
||||||
|
var _posx = _vfx.x_history;
|
||||||
|
var _posy = _vfx.y_history;
|
||||||
|
|
||||||
|
var _trail_ed = min(_vfx.life_incr, _vfx.life_total);
|
||||||
|
var _trail_st = max(1, _vfx.trailLife - _life);
|
||||||
|
var _trail_len = _trail_ed - _trail_st;
|
||||||
|
|
||||||
|
if(_trail_len <= 0) continue;
|
||||||
|
|
||||||
for( var i = 0; i < _len; i++ ) {
|
|
||||||
var _line = lines[i];
|
|
||||||
var _lngh = 0;
|
var _lngh = 0;
|
||||||
var _lenA = [];
|
var _ox = _posx[_trail_st], _nx;
|
||||||
|
var _oy = _posy[_trail_st], _ny;
|
||||||
|
var _line = array_create(_trail_len);
|
||||||
|
var _lenA = array_create(_trail_len - 1);
|
||||||
|
_line[0] = [ _ox, _oy ];
|
||||||
|
|
||||||
var _ox = _line[0], _nx;
|
for( var j = 0; j <= _trail_len; j++ ) {
|
||||||
|
var _index = _trail_st + j;
|
||||||
|
if(j == _trail_len) {
|
||||||
|
_nx = _vfx.drawx;
|
||||||
|
_ny = _vfx.drawy;
|
||||||
|
} else {
|
||||||
|
_nx = _posx[_index];
|
||||||
|
_ny = _posy[_index];
|
||||||
|
}
|
||||||
|
|
||||||
for( var j = 1, m = array_length(_line); j < m; j++ ) {
|
var dist = point_distance(_ox, _oy, _nx, _ny);
|
||||||
_nx = _line[j];
|
|
||||||
|
|
||||||
var p0x = array_safe_get(_ox, 0);
|
|
||||||
var p0y = array_safe_get(_ox, 1);
|
|
||||||
var p1x = array_safe_get(_nx, 0);
|
|
||||||
var p1y = array_safe_get(_nx, 1);
|
|
||||||
|
|
||||||
p0x = is_real(p0x)? p0x : 0;
|
|
||||||
p0y = is_real(p0y)? p0y : 0;
|
|
||||||
p1x = is_real(p1x)? p1x : 0;
|
|
||||||
p1y = is_real(p1y)? p1y : 0;
|
|
||||||
|
|
||||||
var dist = point_distance(p0x, p0y, p1x, p1y);
|
|
||||||
_lngh += dist;
|
_lngh += dist;
|
||||||
array_push(_lenA, dist);
|
_lenA[j] = _lngh;
|
||||||
|
_line[j] = [ _nx, _ny ];
|
||||||
|
|
||||||
_ox = _nx;
|
_ox = _nx;
|
||||||
}
|
}
|
||||||
|
|
||||||
length[i] = _lngh;
|
array_push(lines, _line);
|
||||||
lengthAcc[i] = _lenA;
|
array_push(length, _lngh);
|
||||||
|
array_push(lengthAcc, _lenA);
|
||||||
|
array_push(lineLength, array_length(_line));
|
||||||
|
|
||||||
|
if(_colr)
|
||||||
|
array_push(lineData, {
|
||||||
|
color: _vfx.blend,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
outputs[| 0].setValue(self);
|
outputs[| 0].setValue(self);
|
||||||
|
@ -116,6 +141,6 @@ function Node_VXF_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
|
|
||||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||||
var bbox = drawGetBbox(xx, yy, _s);
|
var bbox = drawGetBbox(xx, yy, _s);
|
||||||
draw_sprite_fit(s_node_path_builder, 0, bbox.xc, bbox.yc, bbox.w, bbox.h);
|
draw_sprite_fit(s_node_vfx_trail, 0, bbox.xc, bbox.yc, bbox.w, bbox.h);
|
||||||
} #endregion
|
} #endregion
|
||||||
}
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "VFX",
|
"name": "effects",
|
||||||
"path": "folders/nodes/data/simulation/VFX.yy",
|
"path": "folders/nodes/data/simulation/VFX/effects.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -59,21 +59,21 @@ function Node_Armature_Path(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
return lerp(_p0[2], _p1[2], _rat);
|
return lerp(_p0[2], _p1[2], _rat);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getPointDistance = function(_dist, _ind = 0) { #region
|
static getPointDistance = function(_dist, _ind = 0, out = undefined) { return getPointRatio(_dist / current_length, _ind, out); }
|
||||||
return getPointRatio(_dist / current_length, _ind);
|
|
||||||
} #endregion
|
static getPointRatio = function(_rat, _ind = 0, out = undefined) { #region
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
|
|
||||||
static getPointRatio = function(_rat, _ind = 0) { #region
|
|
||||||
var _p0 = lines[_ind][0];
|
var _p0 = lines[_ind][0];
|
||||||
var _p1 = lines[_ind][1];
|
var _p1 = lines[_ind][1];
|
||||||
|
|
||||||
if(!is_array(_p0) || array_length(_p0) < 2) return new __vec2();
|
if(!is_array(_p0) || array_length(_p0) < 2) return out;
|
||||||
if(!is_array(_p1) || array_length(_p1) < 2) return new __vec2();
|
if(!is_array(_p1) || array_length(_p1) < 2) return out;
|
||||||
|
|
||||||
var _x = lerp(_p0[0], _p1[0], _rat);
|
out.x = lerp(_p0[0], _p1[0], _rat);
|
||||||
var _y = lerp(_p0[1], _p1[1], _rat);
|
out.y = lerp(_p0[1], _p1[1], _rat);
|
||||||
|
|
||||||
return new __vec2( _x, _y );
|
return out;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static update = function() { #region
|
static update = function() { #region
|
||||||
|
|
|
@ -62,12 +62,14 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
inputs[| 23] = nodeValue("Texture scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
inputs[| 23] = nodeValue("Texture scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||||
.setDisplay(VALUE_DISPLAY.vector);
|
.setDisplay(VALUE_DISPLAY.vector);
|
||||||
|
|
||||||
|
inputs[| 24] = nodeValue("Random Blend", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject(c_white) );
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Output", true], 0, 1,
|
["Output", true], 0, 1,
|
||||||
["Line data", false], 6, 7, 19, 2, 20,
|
["Line data", false], 6, 7, 19, 2, 20,
|
||||||
["Line settings", false], 17, 3, 11, 12, 8, 9, 13, 14,
|
["Line settings", false], 17, 3, 11, 12, 8, 9, 13, 14,
|
||||||
["Wiggle", false], 4, 5,
|
["Wiggle", false], 4, 5,
|
||||||
["Render", false], 10, 15, 16,
|
["Render", false], 10, 24, 15, 16,
|
||||||
["Texture", false], 18, 21, 22, 23,
|
["Texture", false], 18, 21, 22, 23,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -78,7 +80,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
attribute_interpolation();
|
attribute_interpolation();
|
||||||
|
|
||||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
|
||||||
draw_set_color(COLORS._main_accent);
|
draw_set_color(COLORS._main_accent);
|
||||||
for( var i = 0, n = array_length(lines); i < n; i++ ) {
|
for( var i = 0, n = array_length(lines); i < n; i++ ) {
|
||||||
var points = lines[i];
|
var points = lines[i];
|
||||||
|
@ -98,9 +100,9 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
draw_line(x0, y0, x1, y1);
|
draw_line(x0, y0, x1, y1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static step = function() {
|
static step = function() { #region
|
||||||
var px = !getInputData(17);
|
var px = !getInputData(17);
|
||||||
var _tex = inputs[| 18].value_from != noone;
|
var _tex = inputs[| 18].value_from != noone;
|
||||||
var _flen = getInputData(19);
|
var _flen = getInputData(19);
|
||||||
|
@ -117,7 +119,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
|
|
||||||
inputs[| 2].setVisible(!_flen);
|
inputs[| 2].setVisible(!_flen);
|
||||||
inputs[| 20].setVisible( _flen);
|
inputs[| 20].setVisible( _flen);
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _dim = _data[0];
|
var _dim = _data[0];
|
||||||
|
@ -149,6 +151,8 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
var _texRot = _data[22];
|
var _texRot = _data[22];
|
||||||
var _texSca = _data[23];
|
var _texSca = _data[23];
|
||||||
|
|
||||||
|
var _colb = _data[24];
|
||||||
|
|
||||||
inputs[| 14].setVisible(_cap);
|
inputs[| 14].setVisible(_cap);
|
||||||
|
|
||||||
var _rangeMin = min(_ratio[0], _ratio[1]);
|
var _rangeMin = min(_ratio[0], _ratio[1]);
|
||||||
|
@ -174,14 +178,19 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
|
var p = new __vec2();
|
||||||
var _ox, _nx, _nx1, _oy, _ny, _ny1;
|
var _ox, _nx, _nx1, _oy, _ny, _ny1;
|
||||||
var _ow, _nw, _oa, _na, _oc, _nc, _owg, _nwg;
|
var _ow, _nw, _oa, _na, _oc, _nc, _owg, _nwg;
|
||||||
|
var _pathData = [];
|
||||||
|
|
||||||
lines = [];
|
lines = [];
|
||||||
|
|
||||||
if(_use_path) {
|
if(_use_path) { #region
|
||||||
var lineLen = 1;
|
var lineLen = 1;
|
||||||
if(struct_has(_pat, "getLineCount"))
|
if(struct_has(_pat, "getLineCount"))
|
||||||
lineLen = _pat.getLineCount();
|
lineLen = _pat.getLineCount();
|
||||||
|
if(struct_has(_pat, "getPathData"))
|
||||||
|
_pathData = _pat.getPathData();
|
||||||
|
|
||||||
if(_rtMax > 0)
|
if(_rtMax > 0)
|
||||||
for( var i = 0; i < lineLen; i++ ) {
|
for( var i = 0; i < lineLen; i++ ) {
|
||||||
|
@ -207,7 +216,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
var _prog = _prog_curr + 1; //Record previous position to delete from _total
|
var _prog = _prog_curr + 1; //Record previous position to delete from _total
|
||||||
var _prog_total = 0; //Record how far the pointer have moved so far
|
var _prog_total = 0; //Record how far the pointer have moved so far
|
||||||
var points = [];
|
var points = [];
|
||||||
var p, wght;
|
var wght;
|
||||||
|
|
||||||
if(_useDistance) {
|
if(_useDistance) {
|
||||||
_pathStr *= _pathLength;
|
_pathStr *= _pathLength;
|
||||||
|
@ -238,11 +247,11 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
|
|
||||||
wght = 1;
|
wght = 1;
|
||||||
if(_useDistance) {
|
if(_useDistance) {
|
||||||
p = _pat.getPointDistance(_prog_curr, i);
|
p = _pat.getPointDistance(_prog_curr, i, p);
|
||||||
if(struct_has(_pat, "getWeightRatio"))
|
if(struct_has(_pat, "getWeightRatio"))
|
||||||
wght = _pat.getWeightRatio(_prog_curr, i);
|
wght = _pat.getWeightRatio(_prog_curr, i);
|
||||||
} else {
|
} else {
|
||||||
p = _pat.getPointRatio(_prog_curr, i);
|
p = _pat.getPointRatio(_prog_curr, i, p);
|
||||||
if(struct_has(_pat, "getWeightDistance"))
|
if(struct_has(_pat, "getWeightDistance"))
|
||||||
wght = _pat.getWeightDistance(_prog_curr, i);
|
wght = _pat.getWeightDistance(_prog_curr, i);
|
||||||
}
|
}
|
||||||
|
@ -281,7 +290,8 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
|
|
||||||
array_push(lines, points);
|
array_push(lines, points);
|
||||||
}
|
}
|
||||||
} else {
|
#endregion
|
||||||
|
} else { #region
|
||||||
var x0, y0, x1, y1;
|
var x0, y0, x1, y1;
|
||||||
var _0 = point_rectangle_overlap(_dim[0], _dim[1], (_ang + 180) % 360);
|
var _0 = point_rectangle_overlap(_dim[0], _dim[1], (_ang + 180) % 360);
|
||||||
var _1 = point_rectangle_overlap(_dim[0], _dim[1], _ang);
|
var _1 = point_rectangle_overlap(_dim[0], _dim[1], _ang);
|
||||||
|
@ -322,7 +332,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
}
|
}
|
||||||
|
|
||||||
lines = [ points ];
|
lines = [ points ];
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_target(_outSurf);
|
||||||
if(_bg) draw_clear_alpha(0, 1);
|
if(_bg) draw_clear_alpha(0, 1);
|
||||||
|
@ -340,11 +350,16 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
draw_primitive_begin_texture(pr_trianglestrip, tex);
|
draw_primitive_begin_texture(pr_trianglestrip, tex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for( var i = 0, n = array_length(lines); i < n; i++ ) {
|
for( var i = 0, n = array_length(lines); i < n; i++ ) {
|
||||||
var points = lines[i];
|
var points = lines[i];
|
||||||
if(array_length(points) < 2) continue;
|
if(array_length(points) < 2) continue;
|
||||||
|
|
||||||
|
random_set_seed(_sed + i);
|
||||||
var pxs = [];
|
var pxs = [];
|
||||||
|
var dat = array_safe_get(_pathData, i, noone);
|
||||||
|
|
||||||
|
var _col_base = dat == noone? _colb.eval(random(1)) : dat.color;
|
||||||
|
|
||||||
for( var j = 0; j < array_length(points); j++ ) {
|
for( var j = 0; j < array_length(points); j++ ) {
|
||||||
var p0 = points[j];
|
var p0 = points[j];
|
||||||
|
@ -362,7 +377,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
_nw *= eval_curve_x(_widc, _widap? prog : prgc);
|
_nw *= eval_curve_x(_widc, _widap? prog : prgc);
|
||||||
_nw *= p0.weight;
|
_nw *= p0.weight;
|
||||||
|
|
||||||
_nc = _color.eval(_colP? prog : prgc);
|
_nc = colorMultiply(_col_base, _color.eval(_colP? prog : prgc));
|
||||||
|
|
||||||
if(_cap) {
|
if(_cap) {
|
||||||
if(j == 1) {
|
if(j == 1) {
|
||||||
|
|
|
@ -881,10 +881,12 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
static getLength = function() { return lengthTotal; }
|
static getLength = function() { return lengthTotal; }
|
||||||
static getAccuLength = function() { return lengthAccs; }
|
static getAccuLength = function() { return lengthAccs; }
|
||||||
|
|
||||||
static getPointDistance = function(_dist) { #region
|
static getPointDistance = function(_dist, _ind = 0, out = undefined) { #region
|
||||||
if(ds_map_exists(cached_pos, _dist))
|
if(ds_map_exists(cached_pos, _dist))
|
||||||
return cached_pos[? _dist].clone();
|
return cached_pos[? _dist].clone();
|
||||||
|
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
|
|
||||||
var loop = getInputData(1);
|
var loop = getInputData(1);
|
||||||
var rond = getInputData(3);
|
var rond = getInputData(3);
|
||||||
if(!is_real(rond)) rond = false;
|
if(!is_real(rond)) rond = false;
|
||||||
|
@ -895,7 +897,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
var ansize = array_length(lengths);
|
var ansize = array_length(lengths);
|
||||||
var amo = ds_list_size(inputs) - input_fix_len;
|
var amo = ds_list_size(inputs) - input_fix_len;
|
||||||
|
|
||||||
if(ansize == 0) return new __vec2();
|
if(ansize == 0) return out;
|
||||||
|
|
||||||
var _a0, _a1;
|
var _a0, _a1;
|
||||||
|
|
||||||
|
@ -904,7 +906,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
_a1 = array_clone(anchors[safe_mod(i + 1, amo)]);
|
_a1 = array_clone(anchors[safe_mod(i + 1, amo)]);
|
||||||
|
|
||||||
if(!is_array(_a0) || !is_array(_a1))
|
if(!is_array(_a0) || !is_array(_a1))
|
||||||
return new __vec2();
|
return out;
|
||||||
|
|
||||||
if(rond) {
|
if(rond) {
|
||||||
_a0[0] = round(_a0[0]);
|
_a0[0] = round(_a0[0]);
|
||||||
|
@ -920,18 +922,19 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
|
|
||||||
var _t = _dist / lengths[i];
|
var _t = _dist / lengths[i];
|
||||||
var _p = eval_bezier(_t, _a0[0], _a0[1], _a1[0], _a1[1], _a0[0] + _a0[4], _a0[1] + _a0[5], _a1[0] + _a1[2], _a1[1] + _a1[3]);
|
var _p = eval_bezier(_t, _a0[0], _a0[1], _a1[0], _a1[1], _a0[0] + _a0[4], _a0[1] + _a0[5], _a1[0] + _a1[2], _a1[1] + _a1[3]);
|
||||||
var _point = new __vec2(_p);
|
out.x = _p[0];
|
||||||
|
out.y = _p[1];
|
||||||
|
|
||||||
cached_pos[? _oDist] = _point.clone();
|
cached_pos[? _oDist] = out.clone();
|
||||||
return _point;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new __vec2();
|
return out;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getPointRatio = function(_rat) { #region
|
static getPointRatio = function(_rat, _ind = 0, out = undefined) { #region
|
||||||
var pix = frac(_rat) * lengthTotal;
|
var pix = frac(_rat) * lengthTotal;
|
||||||
return getPointDistance(pix);
|
return getPointDistance(pix, _ind, out);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getPointSegment = function(_rat) { #region
|
static getPointSegment = function(_rat) { #region
|
||||||
|
|
|
@ -85,7 +85,9 @@ function Node_Path_Blend(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointRatio = function(_rat, ind = 0) {
|
static getPointRatio = function(_rat, ind = 0, out = undefined) {
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
|
|
||||||
var _path1 = getInputData(0);
|
var _path1 = getInputData(0);
|
||||||
var _path2 = getInputData(1);
|
var _path2 = getInputData(1);
|
||||||
var _lerp = getInputData(2);
|
var _lerp = getInputData(2);
|
||||||
|
@ -93,23 +95,20 @@ function Node_Path_Blend(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
var p1 = _path1 != noone && struct_has(_path1, "getPointRatio");
|
var p1 = _path1 != noone && struct_has(_path1, "getPointRatio");
|
||||||
var p2 = _path2 != noone && struct_has(_path2, "getPointRatio");
|
var p2 = _path2 != noone && struct_has(_path2, "getPointRatio");
|
||||||
|
|
||||||
if(!p1 && !p2) return new __vec2();
|
if(!p1 && !p2) return out;
|
||||||
if( p1 && !p2) return _path1.getPointRatio(_rat, ind);
|
if( p1 && !p2) return _path1.getPointRatio(_rat, ind, out);
|
||||||
if(!p1 && p2) return _path2.getPointRatio(_rat, ind);
|
if(!p1 && p2) return _path2.getPointRatio(_rat, ind, out);
|
||||||
|
|
||||||
var _p1 = _path1.getPointRatio(_rat, ind);
|
var _p1 = _path1.getPointRatio(_rat, ind);
|
||||||
var _p2 = _path2.getPointRatio(_rat, ind);
|
var _p2 = _path2.getPointRatio(_rat, ind);
|
||||||
var _r = new __vec2();
|
|
||||||
|
|
||||||
_r.x = lerp(_p1.x, _p2.x, _lerp);
|
out.x = lerp(_p1.x, _p2.x, _lerp);
|
||||||
_r.y = lerp(_p1.y, _p2.y, _lerp);
|
out.y = lerp(_p1.y, _p2.y, _lerp);
|
||||||
|
|
||||||
return _r;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointDistance = function(_dist, ind = 0) {
|
static getPointDistance = function(_dist, ind = 0, out = undefined) { return getPointRatio(_dist / getLength(ind), ind, out); }
|
||||||
return getPointRatio(_dist / getLength(ind), ind);
|
|
||||||
}
|
|
||||||
|
|
||||||
static getBoundary = function(ind = 0) {
|
static getBoundary = function(ind = 0) {
|
||||||
var _path1 = getInputData(0);
|
var _path1 = getInputData(0);
|
||||||
|
|
|
@ -35,26 +35,27 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
static getLength = function(index) { return array_safe_get(length, index); }
|
static getLength = function(index) { return array_safe_get(length, index); }
|
||||||
static getAccuLength = function(index) { return array_safe_get(lengthAcc, index, []); }
|
static getAccuLength = function(index) { return array_safe_get(lengthAcc, index, []); }
|
||||||
|
|
||||||
static getPointRatio = function(_rat, _ind = 0) { #region
|
static getPointRatio = function(_rat, _ind = 0, out = undefined) { #region
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
|
|
||||||
var _p0, _p1;
|
var _p0, _p1;
|
||||||
var _x, _y;
|
var _x, _y;
|
||||||
|
|
||||||
var line = array_safe_get(lines, _ind, []);
|
var line = array_safe_get(lines, _ind, []);
|
||||||
|
var _st = _rat * (array_length(line) - 1);
|
||||||
var _st = _rat * (array_length(line) - 1);
|
|
||||||
_p0 = array_safe_get(line, floor(_st) + 0);
|
_p0 = array_safe_get(line, floor(_st) + 0);
|
||||||
_p1 = array_safe_get(line, floor(_st) + 1);
|
_p1 = array_safe_get(line, floor(_st) + 1);
|
||||||
|
|
||||||
if(!is_array(_p0)) return new __vec2();
|
if(!is_array(_p0)) return out;
|
||||||
if(!is_array(_p1)) return new __vec2();
|
if(!is_array(_p1)) return out;
|
||||||
|
|
||||||
_x = lerp(_p0[0], _p1[0], frac(_st));
|
out.x = lerp(_p0[0], _p1[0], frac(_st));
|
||||||
_y = lerp(_p0[1], _p1[1], frac(_st));
|
out.y = lerp(_p0[1], _p1[1], frac(_st));
|
||||||
|
|
||||||
return new __vec2( _x, _y );
|
return out;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getPointDistance = function(_dist, ind = 0) { return getPointRatio(_dist / length[ind], ind); }
|
static getPointDistance = function(_dist, ind = 0, out = undefined) { return getPointRatio(_dist / length[ind], ind, out); }
|
||||||
|
|
||||||
static getBoundary = function() { #region
|
static getBoundary = function() { #region
|
||||||
var boundary = new BoundingBox();
|
var boundary = new BoundingBox();
|
||||||
|
|
|
@ -188,22 +188,22 @@ function Node_Path_L_System(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
return lerp(_p0[2], _p1[2], _rat);
|
return lerp(_p0[2], _p1[2], _rat);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getPointRatio = function(_rat, _ind = 0) { #region
|
static getPointRatio = function(_rat, _ind = 0, out = undefined) { #region
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
|
|
||||||
var _p0 = lines[_ind][0];
|
var _p0 = lines[_ind][0];
|
||||||
var _p1 = lines[_ind][1];
|
var _p1 = lines[_ind][1];
|
||||||
|
|
||||||
if(!is_array(_p0) || array_length(_p0) < 2) return new __vec2();
|
if(!is_array(_p0) || array_length(_p0) < 2) return out;
|
||||||
if(!is_array(_p1) || array_length(_p1) < 2) return new __vec2();
|
if(!is_array(_p1) || array_length(_p1) < 2) return out;
|
||||||
|
|
||||||
var _x = lerp(_p0[0], _p1[0], _rat);
|
out.x = lerp(_p0[0], _p1[0], _rat);
|
||||||
var _y = lerp(_p0[1], _p1[1], _rat);
|
out.y = lerp(_p0[1], _p1[1], _rat);
|
||||||
|
|
||||||
return new __vec2( _x, _y );
|
return out;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getPointDistance = function(_dist, _ind = 0) { #region
|
static getPointDistance = function(_dist, _ind = 0, out = undefined) { return getPointRatio(_dist / current_length, _ind, out); }
|
||||||
return getPointRatio(_dist / current_length, _ind);
|
|
||||||
} #endregion
|
|
||||||
|
|
||||||
static getBoundary = function() { return boundary; }
|
static getBoundary = function() { return boundary; }
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,9 @@ function Node_Path_Map_Area(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
return struct_has(_path, "getAccuLength")? _path.getAccuLength(ind) : [];
|
return struct_has(_path, "getAccuLength")? _path.getAccuLength(ind) : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointRatio = function(_rat, ind = 0) {
|
static getPointRatio = function(_rat, ind = 0, out = undefined) {
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
|
|
||||||
var _path = getInputData(0);
|
var _path = getInputData(0);
|
||||||
var _area = getInputData(1);
|
var _area = getInputData(1);
|
||||||
|
|
||||||
|
@ -47,20 +49,18 @@ function Node_Path_Map_Area(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_struct(_path) || !struct_has(_path, "getPointRatio"))
|
if(!is_struct(_path) || !struct_has(_path, "getPointRatio"))
|
||||||
return new __vec2();
|
return out;
|
||||||
|
|
||||||
var _b = _path.getBoundary();
|
var _b = _path.getBoundary();
|
||||||
var _p = _path.getPointRatio(_rat, ind).clone();
|
var _p = _path.getPointRatio(_rat, ind);
|
||||||
|
|
||||||
_p.x = (_area[AREA_INDEX.center_x] - _area[AREA_INDEX.half_w]) + (_p.x - _b.minx) / _b.width * _area[AREA_INDEX.half_w] * 2;
|
out.x = (_area[AREA_INDEX.center_x] - _area[AREA_INDEX.half_w]) + (_p.x - _b.minx) / _b.width * _area[AREA_INDEX.half_w] * 2;
|
||||||
_p.y = (_area[AREA_INDEX.center_y] - _area[AREA_INDEX.half_h]) + (_p.y - _b.miny) / _b.height * _area[AREA_INDEX.half_h] * 2;
|
out.y = (_area[AREA_INDEX.center_y] - _area[AREA_INDEX.half_h]) + (_p.y - _b.miny) / _b.height * _area[AREA_INDEX.half_h] * 2;
|
||||||
|
|
||||||
return _p;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointDistance = function(_dist, ind = 0) {
|
static getPointDistance = function(_dist, ind = 0, out = undefined) { return getPointRatio(_dist / getLength(), ind, out); }
|
||||||
return getPointRatio(_dist / getLength(), ind);
|
|
||||||
}
|
|
||||||
|
|
||||||
static getBoundary = function() {
|
static getBoundary = function() {
|
||||||
var _area = getInputData(1);
|
var _area = getInputData(1);
|
||||||
|
|
|
@ -50,7 +50,9 @@ function Node_Path_Plot(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
static getLength = function(ind = 0) { return length; }
|
static getLength = function(ind = 0) { return length; }
|
||||||
static getAccuLength = function(ind = 0) { return [ length ]; }
|
static getAccuLength = function(ind = 0) { return [ length ]; }
|
||||||
|
|
||||||
static getPointRatio = function(_rat, ind = 0) {
|
static getPointRatio = function(_rat, ind = 0, out = undefined) {
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
|
|
||||||
var _sca = getInputData(0);
|
var _sca = getInputData(0);
|
||||||
var _coor = getInputData(1);
|
var _coor = getInputData(1);
|
||||||
var _eqa = getInputData(2);
|
var _eqa = getInputData(2);
|
||||||
|
@ -63,22 +65,20 @@ function Node_Path_Plot(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
|
|
||||||
_rat = _ran[0] + (_rat * (_ran[1] - _ran[0]));
|
_rat = _ran[0] + (_rat * (_ran[1] - _ran[0]));
|
||||||
|
|
||||||
var _p = new __vec2();
|
|
||||||
|
|
||||||
switch(_coor) {
|
switch(_coor) {
|
||||||
case 0 :
|
case 0 :
|
||||||
switch(_eqa) {
|
switch(_eqa) {
|
||||||
case 0 :
|
case 0 :
|
||||||
_p.x = _rat * _iran[0] + _shf[0];
|
out.x = _rat * _iran[0] + _shf[0];
|
||||||
_p.y = evaluateFunction(_eq0, { x: _rat * _iran[0] + _shf[0] });
|
out.y = evaluateFunction(_eq0, { x: _rat * _iran[0] + _shf[0] });
|
||||||
break;
|
break;
|
||||||
case 1 :
|
case 1 :
|
||||||
_p.x = evaluateFunction(_eq0, { y: _rat * _iran[1] + _shf[1] });
|
out.x = evaluateFunction(_eq0, { y: _rat * _iran[1] + _shf[1] });
|
||||||
_p.y = _rat * _iran[1] + _shf[1];
|
out.y = _rat * _iran[1] + _shf[1];
|
||||||
break;
|
break;
|
||||||
case 2 :
|
case 2 :
|
||||||
_p.x = evaluateFunction(_eq0, { t: _rat * _iran[0] + _shf[0] });
|
out.x = evaluateFunction(_eq0, { t: _rat * _iran[0] + _shf[0] });
|
||||||
_p.y = evaluateFunction(_eq1, { t: _rat * _iran[1] + _shf[1] });
|
out.y = evaluateFunction(_eq1, { t: _rat * _iran[1] + _shf[1] });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -99,20 +99,18 @@ function Node_Path_Plot(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_p.x = cos(_a.y) * _a.x;
|
out.x = cos(_a.y) * _a.x;
|
||||||
_p.y = -sin(_a.y) * _a.x;
|
out.y = -sin(_a.y) * _a.x;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_p.x = _p.x * _sca[0] + _orig[0];
|
out.x = out.x * _sca[0] + _orig[0];
|
||||||
_p.y = -_p.y * _sca[1] + _orig[1];
|
out.y = -out.y * _sca[1] + _orig[1];
|
||||||
|
|
||||||
return _p;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointDistance = function(_dist, ind = 0) {
|
static getPointDistance = function(_dist, ind = 0, out = undefined) { return getPointRatio(_dist / getLength(ind), ind, out); }
|
||||||
return getPointRatio(_dist / getLength(ind), ind);
|
|
||||||
}
|
|
||||||
|
|
||||||
static getBoundary = function() { return boundary; }
|
static getBoundary = function() { return boundary; }
|
||||||
|
|
||||||
|
|
|
@ -34,17 +34,16 @@ function Node_Path_Reverse(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
return struct_has(_path, "getBoundary")? _path.getBoundary(ind) : new BoundingBox(0, 0, 1, 1);
|
return struct_has(_path, "getBoundary")? _path.getBoundary(ind) : new BoundingBox(0, 0, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointRatio = function(_rat, ind = 0) {
|
static getPointRatio = function(_rat, ind = 0, out = undefined) {
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
var _path = getInputData(0);
|
var _path = getInputData(0);
|
||||||
|
|
||||||
if(!is_struct(_path) || !struct_has(_path, "getPointRatio"))
|
if(!is_struct(_path) || !struct_has(_path, "getPointRatio"))
|
||||||
return new __vec2();
|
return out;
|
||||||
return _path.getPointRatio(1 - _rat, ind).clone();
|
return _path.getPointRatio(1 - _rat, ind, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointDistance = function(_dist, ind = 0) {
|
static getPointDistance = function(_dist, ind = 0, out = undefined) { return getPointRatio(_dist / getLength(), ind, out); }
|
||||||
return getPointRatio(_dist / getLength(), ind);
|
|
||||||
}
|
|
||||||
|
|
||||||
static update = function() {
|
static update = function() {
|
||||||
outputs[| 0].setValue(self);
|
outputs[| 0].setValue(self);
|
||||||
|
|
|
@ -31,7 +31,9 @@ function Node_Path_Shift(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
return struct_has(_path, "getAccuLength")? _path.getAccuLength(ind) : [];
|
return struct_has(_path, "getAccuLength")? _path.getAccuLength(ind) : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointRatio = function(_rat, ind = 0) {
|
static getPointRatio = function(_rat, ind = 0, out = undefined) {
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
|
|
||||||
var _path = getInputData(0);
|
var _path = getInputData(0);
|
||||||
var _shf = getInputData(1);
|
var _shf = getInputData(1);
|
||||||
|
|
||||||
|
@ -41,23 +43,21 @@ function Node_Path_Shift(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_struct(_path) || !struct_has(_path, "getPointRatio"))
|
if(!is_struct(_path) || !struct_has(_path, "getPointRatio"))
|
||||||
return new __vec2();
|
return out;
|
||||||
|
|
||||||
var _p0 = _path.getPointRatio(clamp(_rat - 0.001, 0, 0.999999), ind);
|
var _p0 = _path.getPointRatio(clamp(_rat - 0.001, 0, 0.999999), ind);
|
||||||
var _p = _path.getPointRatio(_rat, ind).clone();
|
var _p = _path.getPointRatio(_rat, ind);
|
||||||
var _p1 = _path.getPointRatio(clamp(_rat + 0.001, 0, 0.999999), ind);
|
var _p1 = _path.getPointRatio(clamp(_rat + 0.001, 0, 0.999999), ind);
|
||||||
|
|
||||||
var dir = point_direction(_p0.x, _p0.y, _p1.x, _p1.y) + 90;
|
var dir = point_direction(_p0.x, _p0.y, _p1.x, _p1.y) + 90;
|
||||||
|
|
||||||
_p.x += lengthdir_x(_shf, dir);
|
out.x += _p.x + lengthdir_x(_shf, dir);
|
||||||
_p.y += lengthdir_y(_shf, dir);
|
out.y += _p.y + lengthdir_y(_shf, dir);
|
||||||
|
|
||||||
return _p;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointDistance = function(_dist, ind = 0) {
|
static getPointDistance = function(_dist, ind = 0, out = undefined) { return getPointRatio(_dist / getLength(), ind, out); }
|
||||||
return getPointRatio(_dist / getLength(), ind);
|
|
||||||
}
|
|
||||||
|
|
||||||
static getBoundary = function(ind = 0) {
|
static getBoundary = function(ind = 0) {
|
||||||
var _path = getInputData(0);
|
var _path = getInputData(0);
|
||||||
|
|
|
@ -83,7 +83,9 @@ function Node_Path_Transform(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
return new BoundingBox(_minx, _miny, _maxx, _maxy);
|
return new BoundingBox(_minx, _miny, _maxx, _maxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointRatio = function(_rat, ind = 0) {
|
static getPointRatio = function(_rat, ind = 0, out = undefined) {
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
|
|
||||||
var _path = getInputData(0);
|
var _path = getInputData(0);
|
||||||
var _pos = getInputData(1);
|
var _pos = getInputData(1);
|
||||||
var _rot = getInputData(2);
|
var _rot = getInputData(2);
|
||||||
|
@ -96,7 +98,7 @@ function Node_Path_Transform(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_struct(_path) || !struct_has(_path, "getPointRatio"))
|
if(!is_struct(_path) || !struct_has(_path, "getPointRatio"))
|
||||||
return new __vec2();
|
return out;
|
||||||
|
|
||||||
var _p = _path.getPointRatio(_rat, ind).clone();
|
var _p = _path.getPointRatio(_rat, ind).clone();
|
||||||
|
|
||||||
|
@ -105,15 +107,13 @@ function Node_Path_Transform(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
|
|
||||||
var _pp = point_rotate(_p.x, _p.y, _anc[0], _anc[1], _rot);
|
var _pp = point_rotate(_p.x, _p.y, _anc[0], _anc[1], _rot);
|
||||||
|
|
||||||
_p.x = _pp[0] + _pos[0];
|
out.x = _pp[0] + _pos[0];
|
||||||
_p.y = _pp[1] + _pos[1];
|
out.y = _pp[1] + _pos[1];
|
||||||
|
|
||||||
return _p;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointDistance = function(_dist, ind = 0) {
|
static getPointDistance = function(_dist, ind = 0, out = undefined) { return getPointRatio(_dist / getLength(), ind, out); }
|
||||||
return getPointRatio(_dist / getLength(), ind);
|
|
||||||
}
|
|
||||||
|
|
||||||
static getBoundary = function(ind = 0) {
|
static getBoundary = function(ind = 0) {
|
||||||
var _path = getInputData(0);
|
var _path = getInputData(0);
|
||||||
|
|
|
@ -32,7 +32,9 @@ function Node_Path_Trim(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
return struct_has(_path, "getAccuLength")? _path.getAccuLength(ind) : [];
|
return struct_has(_path, "getAccuLength")? _path.getAccuLength(ind) : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointRatio = function(_rat, ind = 0) {
|
static getPointRatio = function(_rat, ind = 0, out = undefined) {
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
|
|
||||||
var _path = getInputData(0);
|
var _path = getInputData(0);
|
||||||
var _rng = getInputData(1);
|
var _rng = getInputData(1);
|
||||||
|
|
||||||
|
@ -42,15 +44,13 @@ function Node_Path_Trim(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_struct(_path) || !struct_has(_path, "getPointRatio"))
|
if(!is_struct(_path) || !struct_has(_path, "getPointRatio"))
|
||||||
return new __vec2();
|
return out;
|
||||||
|
|
||||||
_rat = _rng[0] + _rat * (_rng[1] - _rng[0]);
|
_rat = _rng[0] + _rat * (_rng[1] - _rng[0]);
|
||||||
return _path.getPointRatio(_rat, ind).clone();
|
return _path.getPointRatio(_rat, ind, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointDistance = function(_dist, ind = 0) {
|
static getPointDistance = function(_dist, ind = 0, out = undefined) { return getPointRatio(_dist / getLength(), ind, out); }
|
||||||
return getPointRatio(_dist / getLength(), ind);
|
|
||||||
}
|
|
||||||
|
|
||||||
static getBoundary = function(ind = 0) {
|
static getBoundary = function(ind = 0) {
|
||||||
var _path = getInputData(0);
|
var _path = getInputData(0);
|
||||||
|
|
|
@ -57,7 +57,9 @@ function Node_Path_Wave(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
return _len;
|
return _len;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointRatio = function(_rat, ind = 0) {
|
static getPointRatio = function(_rat, ind = 0, out = undefined) {
|
||||||
|
if(out == undefined) out = new __vec2(); else { out.x = 0; out.y = 0; }
|
||||||
|
|
||||||
var _path = getInputData(0);
|
var _path = getInputData(0);
|
||||||
var _fre = getInputData(1); _fre = max(0.01, abs(_fre));
|
var _fre = getInputData(1); _fre = max(0.01, abs(_fre));
|
||||||
var _amo = getInputData(2);
|
var _amo = getInputData(2);
|
||||||
|
@ -70,7 +72,7 @@ function Node_Path_Wave(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_struct(_path) || !struct_has(_path, "getPointRatio"))
|
if(!is_struct(_path) || !struct_has(_path, "getPointRatio"))
|
||||||
return new __vec2();
|
return out;
|
||||||
|
|
||||||
var _p0 = _path.getPointRatio(clamp(_rat - 0.001, 0, 0.999999), ind);
|
var _p0 = _path.getPointRatio(clamp(_rat - 0.001, 0, 0.999999), ind);
|
||||||
var _p = _path.getPointRatio(_rat, ind).clone();
|
var _p = _path.getPointRatio(_rat, ind).clone();
|
||||||
|
@ -82,15 +84,13 @@ function Node_Path_Wave(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
if(_smt) prg = cos((_shf + _rat * _fre) * pi * 2);
|
if(_smt) prg = cos((_shf + _rat * _fre) * pi * 2);
|
||||||
else prg = (abs(frac(_shf + _rat * _fre) * 2 - 1) - 0.5) * 2;
|
else prg = (abs(frac(_shf + _rat * _fre) * 2 - 1) - 0.5) * 2;
|
||||||
|
|
||||||
_p.x = _p.x + lengthdir_x(prg * _amo, dir);
|
out.x = _p.x + lengthdir_x(prg * _amo, dir);
|
||||||
_p.y = _p.y + lengthdir_y(prg * _amo, dir);
|
out.y = _p.y + lengthdir_y(prg * _amo, dir);
|
||||||
|
|
||||||
return _p;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointDistance = function(_dist, ind = 0) {
|
static getPointDistance = function(_dist, ind = 0, out = undefined) { return getPointRatio(_dist / getLength(), ind, out); }
|
||||||
return getPointRatio(_dist / getLength(), ind);
|
|
||||||
}
|
|
||||||
|
|
||||||
static getBoundary = function(ind = 0) {
|
static getBoundary = function(ind = 0) {
|
||||||
var _path = getInputData(0);
|
var _path = getInputData(0);
|
||||||
|
|
|
@ -183,6 +183,10 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
|
||||||
addNodeObject(vfx, "Vortex", s_node_vfx_vortex, "Node_VFX_Vortex", [1, Node_VFX_Vortex]).hideRecent();
|
addNodeObject(vfx, "Vortex", s_node_vfx_vortex, "Node_VFX_Vortex", [1, Node_VFX_Vortex]).hideRecent();
|
||||||
addNodeObject(vfx, "Turbulence", s_node_vfx_turb, "Node_VFX_Turbulence", [1, Node_VFX_Turbulence]).hideRecent();
|
addNodeObject(vfx, "Turbulence", s_node_vfx_turb, "Node_VFX_Turbulence", [1, Node_VFX_Turbulence]).hideRecent();
|
||||||
addNodeObject(vfx, "Repel", s_node_vfx_repel, "Node_VFX_Repel", [1, Node_VFX_Repel]).hideRecent();
|
addNodeObject(vfx, "Repel", s_node_vfx_repel, "Node_VFX_Repel", [1, Node_VFX_Repel]).hideRecent();
|
||||||
|
addNodeObject(vfx, "Oscillate", s_node_vfx_osc, "Node_VFX_Oscillate", [1, Node_VFX_Oscillate]).hideRecent().setVersion(11560);
|
||||||
|
|
||||||
|
ds_list_add(vfx, "Effects");
|
||||||
|
addNodeObject(vfx, "VFX Trail", s_node_vfx_trail, "Node_VFX_Trail", [1, Node_VFX_Trail]).hideRecent().setVersion(11560);
|
||||||
|
|
||||||
ds_list_add(vfx, "Instance control");
|
ds_list_add(vfx, "Instance control");
|
||||||
addNodeObject(vfx, "VFX Variable", s_node_vfx_variable, "Node_VFX_Variable", [1, Node_VFX_Variable]).hideRecent().setVersion(1120);
|
addNodeObject(vfx, "VFX Variable", s_node_vfx_variable, "Node_VFX_Variable", [1, Node_VFX_Variable]).hideRecent().setVersion(1120);
|
||||||
|
|
BIN
sprites/s_node_vfx_osc/bbcb8f25-322d-4324-be8e-735cd9841834.png
Normal file
BIN
sprites/s_node_vfx_osc/bbcb8f25-322d-4324-be8e-735cd9841834.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
74
sprites/s_node_vfx_osc/s_node_vfx_osc.yy
Normal file
74
sprites/s_node_vfx_osc/s_node_vfx_osc.yy
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
{
|
||||||
|
"resourceType": "GMSprite",
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "s_node_vfx_osc",
|
||||||
|
"bbox_bottom": 46,
|
||||||
|
"bbox_left": 2,
|
||||||
|
"bbox_right": 61,
|
||||||
|
"bbox_top": 16,
|
||||||
|
"bboxMode": 0,
|
||||||
|
"collisionKind": 1,
|
||||||
|
"collisionTolerance": 0,
|
||||||
|
"DynamicTexturePage": false,
|
||||||
|
"edgeFiltering": false,
|
||||||
|
"For3D": false,
|
||||||
|
"frames": [
|
||||||
|
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"bbcb8f25-322d-4324-be8e-735cd9841834",},
|
||||||
|
],
|
||||||
|
"gridX": 0,
|
||||||
|
"gridY": 0,
|
||||||
|
"height": 64,
|
||||||
|
"HTile": false,
|
||||||
|
"layers": [
|
||||||
|
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"a4270f72-0a04-4469-8a8b-0b6b2f7f61e8","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
|
||||||
|
],
|
||||||
|
"nineSlice": null,
|
||||||
|
"origin": 4,
|
||||||
|
"parent": {
|
||||||
|
"name": "VFX",
|
||||||
|
"path": "folders/nodes/icons/VFX.yy",
|
||||||
|
},
|
||||||
|
"preMultiplyAlpha": false,
|
||||||
|
"sequence": {
|
||||||
|
"resourceType": "GMSequence",
|
||||||
|
"resourceVersion": "1.4",
|
||||||
|
"name": "s_node_vfx_osc",
|
||||||
|
"autoRecord": true,
|
||||||
|
"backdropHeight": 768,
|
||||||
|
"backdropImageOpacity": 0.5,
|
||||||
|
"backdropImagePath": "",
|
||||||
|
"backdropWidth": 1366,
|
||||||
|
"backdropXOffset": 0.0,
|
||||||
|
"backdropYOffset": 0.0,
|
||||||
|
"events": {"resourceType":"KeyframeStore<MessageEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
|
||||||
|
"eventStubScript": null,
|
||||||
|
"eventToFunction": {},
|
||||||
|
"length": 1.0,
|
||||||
|
"lockOrigin": false,
|
||||||
|
"moments": {"resourceType":"KeyframeStore<MomentsEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
|
||||||
|
"playback": 1,
|
||||||
|
"playbackSpeed": 30.0,
|
||||||
|
"playbackSpeedType": 0,
|
||||||
|
"showBackdrop": true,
|
||||||
|
"showBackdropImage": false,
|
||||||
|
"timeUnits": 1,
|
||||||
|
"tracks": [
|
||||||
|
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
|
||||||
|
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"bbcb8f25-322d-4324-be8e-735cd9841834","path":"sprites/s_node_vfx_osc/s_node_vfx_osc.yy",},},},"Disabled":false,"id":"7181b459-5a9b-4c6c-9086-1ed2189e4803","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
|
||||||
|
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
|
||||||
|
],
|
||||||
|
"visibleRange": null,
|
||||||
|
"volume": 1.0,
|
||||||
|
"xorigin": 32,
|
||||||
|
"yorigin": 32,
|
||||||
|
},
|
||||||
|
"swatchColours": null,
|
||||||
|
"swfPrecision": 2.525,
|
||||||
|
"textureGroupId": {
|
||||||
|
"name": "Default",
|
||||||
|
"path": "texturegroups/Default",
|
||||||
|
},
|
||||||
|
"type": 0,
|
||||||
|
"VTile": false,
|
||||||
|
"width": 64,
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
74
sprites/s_node_vfx_trail/s_node_vfx_trail.yy
Normal file
74
sprites/s_node_vfx_trail/s_node_vfx_trail.yy
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
{
|
||||||
|
"resourceType": "GMSprite",
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "s_node_vfx_trail",
|
||||||
|
"bbox_bottom": 60,
|
||||||
|
"bbox_left": 6,
|
||||||
|
"bbox_right": 57,
|
||||||
|
"bbox_top": 6,
|
||||||
|
"bboxMode": 0,
|
||||||
|
"collisionKind": 1,
|
||||||
|
"collisionTolerance": 0,
|
||||||
|
"DynamicTexturePage": false,
|
||||||
|
"edgeFiltering": false,
|
||||||
|
"For3D": false,
|
||||||
|
"frames": [
|
||||||
|
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"ec7e642d-f177-401b-8170-cd85e15f73b1",},
|
||||||
|
],
|
||||||
|
"gridX": 0,
|
||||||
|
"gridY": 0,
|
||||||
|
"height": 64,
|
||||||
|
"HTile": false,
|
||||||
|
"layers": [
|
||||||
|
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"4b8a939f-c4b9-4560-9f87-0e4aec9b9e1b","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
|
||||||
|
],
|
||||||
|
"nineSlice": null,
|
||||||
|
"origin": 4,
|
||||||
|
"parent": {
|
||||||
|
"name": "VFX",
|
||||||
|
"path": "folders/nodes/icons/VFX.yy",
|
||||||
|
},
|
||||||
|
"preMultiplyAlpha": false,
|
||||||
|
"sequence": {
|
||||||
|
"resourceType": "GMSequence",
|
||||||
|
"resourceVersion": "1.4",
|
||||||
|
"name": "s_node_vfx_trail",
|
||||||
|
"autoRecord": true,
|
||||||
|
"backdropHeight": 768,
|
||||||
|
"backdropImageOpacity": 0.5,
|
||||||
|
"backdropImagePath": "",
|
||||||
|
"backdropWidth": 1366,
|
||||||
|
"backdropXOffset": 0.0,
|
||||||
|
"backdropYOffset": 0.0,
|
||||||
|
"events": {"resourceType":"KeyframeStore<MessageEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
|
||||||
|
"eventStubScript": null,
|
||||||
|
"eventToFunction": {},
|
||||||
|
"length": 1.0,
|
||||||
|
"lockOrigin": false,
|
||||||
|
"moments": {"resourceType":"KeyframeStore<MomentsEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
|
||||||
|
"playback": 1,
|
||||||
|
"playbackSpeed": 30.0,
|
||||||
|
"playbackSpeedType": 0,
|
||||||
|
"showBackdrop": true,
|
||||||
|
"showBackdropImage": false,
|
||||||
|
"timeUnits": 1,
|
||||||
|
"tracks": [
|
||||||
|
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
|
||||||
|
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"ec7e642d-f177-401b-8170-cd85e15f73b1","path":"sprites/s_node_vfx_trail/s_node_vfx_trail.yy",},},},"Disabled":false,"id":"1be8543a-938a-4680-b1d6-502f8412462f","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
|
||||||
|
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
|
||||||
|
],
|
||||||
|
"visibleRange": null,
|
||||||
|
"volume": 1.0,
|
||||||
|
"xorigin": 32,
|
||||||
|
"yorigin": 32,
|
||||||
|
},
|
||||||
|
"swatchColours": null,
|
||||||
|
"swfPrecision": 2.525,
|
||||||
|
"textureGroupId": {
|
||||||
|
"name": "Default",
|
||||||
|
"path": "texturegroups/Default",
|
||||||
|
},
|
||||||
|
"type": 0,
|
||||||
|
"VTile": false,
|
||||||
|
"width": 64,
|
||||||
|
}
|
Loading…
Reference in a new issue