diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-01-07 20:29:05 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-01-07 20:29:05 -0300 |
commit | 3f1dd9c57ff684e1d2441da43c6da8a19b507973 (patch) | |
tree | c120862b352ae92fd643f29af0d5b10786a44295 /tools/editor | |
parent | 1659f82e7e178c5bd6ff2fe02b600669b427245e (diff) |
-Fixed matrix and vec+scalar multiplication issues, fixes #1143
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/plugins/shader_graph_editor_plugin.cpp | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index 5100a8f675..e0629fdda9 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -745,14 +745,9 @@ void ShaderGraphView::_create_node(int p_id) { } break; // mat4 x mat4 - case ShaderGraph::NODE_XFORM_VEC_MULT: - case ShaderGraph::NODE_XFORM_VEC_INV_MULT: { - - if (graph->node_get_type(type,p_id)==ShaderGraph::NODE_XFORM_VEC_INV_MULT) - gn->set_title("XFVecMult"); - else - gn->set_title("XFVecInvMult"); + case ShaderGraph::NODE_XFORM_VEC_MULT: { + gn->set_title("XFVecMult"); Button *button = memnew( Button("RotOnly")); button->set_toggle_mode(true); @@ -774,6 +769,32 @@ void ShaderGraphView::_create_node(int p_id) { gn->set_slot(1,true,ShaderGraph::SLOT_TYPE_XFORM,typecol[ShaderGraph::SLOT_TYPE_XFORM],true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC]); gn->set_slot(2,true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC],false,0,Color()); + } break; + case ShaderGraph::NODE_XFORM_VEC_INV_MULT: { + + gn->set_title("XFVecInvMult"); + + + Button *button = memnew( Button("RotOnly")); + button->set_toggle_mode(true); + button->set_pressed(graph->xform_vec_mult_node_get_no_translation(type,p_id)); + button->connect("toggled",this,"_xform_inv_rev_changed",varray(p_id)); + + gn->add_child(button); + + gn->add_child( memnew(Label("vec"))); + HBoxContainer *hbc = memnew( HBoxContainer ); + hbc->add_constant_override("separation",0); + hbc->add_child( memnew(Label("xf"))); + hbc->add_spacer(); + Label *l = memnew(Label("out")); + l->set_align(Label::ALIGN_RIGHT); + hbc->add_child( l); + gn->add_child(hbc); + + gn->set_slot(1,true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC],false,0,Color()); + gn->set_slot(2,true,ShaderGraph::SLOT_TYPE_XFORM,typecol[ShaderGraph::SLOT_TYPE_XFORM],true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC]); + } break; // mat4 x vec3 inverse mult (with no-translation option) case ShaderGraph::NODE_SCALAR_FUNC: { |