mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-11-18 08:00:37 +01:00
Insulated double corner (#524)
* Add insulated double corner * Make single corner curved to match double corner * Remove obsolete regular corner textures
This commit is contained in:
parent
4750925eab
commit
9fda51b650
@ -1,12 +1,5 @@
|
||||
local screwdriver_exists = minetest.global_exists("screwdriver")
|
||||
|
||||
local corner_nodebox = {
|
||||
type = "fixed",
|
||||
-- ±0.001 is to prevent z-fighting
|
||||
fixed = {{ -16/32-0.001, -17/32, -3/32, 0, -13/32, 3/32 },
|
||||
{ -3/32, -17/32, -16/32+0.001, 3/32, -13/32, 3/32}}
|
||||
}
|
||||
|
||||
local corner_selectionbox = {
|
||||
type = "fixed",
|
||||
fixed = { -16/32, -16/32, -16/32, 5/32, -12/32, 5/32 },
|
||||
@ -25,14 +18,11 @@ local corner_get_rules = function (node)
|
||||
end
|
||||
|
||||
minetest.register_node("mesecons_extrawires:corner_on", {
|
||||
drawtype = "nodebox",
|
||||
drawtype = "mesh",
|
||||
mesh = "mesecons_extrawires_corner.obj",
|
||||
tiles = {
|
||||
"jeija_insulated_wire_curved_tb_on.png",
|
||||
"jeija_insulated_wire_curved_tb_on.png^[transformR270",
|
||||
"jeija_insulated_wire_sides_on.png",
|
||||
"jeija_insulated_wire_ends_on.png",
|
||||
"jeija_insulated_wire_sides_on.png",
|
||||
"jeija_insulated_wire_ends_on.png"
|
||||
{ name = "jeija_insulated_wire_sides_on.png", backface_culling = true },
|
||||
{ name = "jeija_insulated_wire_ends_on.png", backface_culling = true },
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
@ -55,15 +45,12 @@ minetest.register_node("mesecons_extrawires:corner_on", {
|
||||
})
|
||||
|
||||
minetest.register_node("mesecons_extrawires:corner_off", {
|
||||
drawtype = "nodebox",
|
||||
drawtype = "mesh",
|
||||
description = "Insulated Mesecon Corner",
|
||||
mesh = "mesecons_extrawires_corner.obj",
|
||||
tiles = {
|
||||
"jeija_insulated_wire_curved_tb_off.png",
|
||||
"jeija_insulated_wire_curved_tb_off.png^[transformR270",
|
||||
"jeija_insulated_wire_sides_off.png",
|
||||
"jeija_insulated_wire_ends_off.png",
|
||||
"jeija_insulated_wire_sides_off.png",
|
||||
"jeija_insulated_wire_ends_off.png"
|
||||
{ name = "jeija_insulated_wire_sides_off.png", backface_culling = true },
|
||||
{ name = "jeija_insulated_wire_ends_off.png", backface_culling = true },
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
|
91
mesecons_extrawires/doublecorner.lua
Normal file
91
mesecons_extrawires/doublecorner.lua
Normal file
@ -0,0 +1,91 @@
|
||||
local rotate
|
||||
if minetest.global_exists("screwdriver") then rotate = screwdriver.rotate_simple end
|
||||
|
||||
local doublecorner_selectionbox = {
|
||||
type = "fixed",
|
||||
fixed = { -8/16, -8/16, -8/16, 8/16, -6/16, 8/16 },
|
||||
}
|
||||
|
||||
local rules = {
|
||||
{
|
||||
{ x = 1, y = 0, z = 0 },
|
||||
{ x = 0, y = 0, z = 1 },
|
||||
},
|
||||
{
|
||||
{ x = -1, y = 0, z = 0 },
|
||||
{ x = 0, y = 0, z = -1 },
|
||||
},
|
||||
}
|
||||
|
||||
local doublecorner_rules = {}
|
||||
for k = 1, 4 do
|
||||
doublecorner_rules[k] = table.copy(rules)
|
||||
for i, r in ipairs(rules) do
|
||||
rules[i] = mesecon.rotate_rules_left(r)
|
||||
end
|
||||
end
|
||||
|
||||
local function doublecorner_get_rules(node)
|
||||
return doublecorner_rules[node.param2 % 4 + 1]
|
||||
end
|
||||
|
||||
local doublecorner_states = {
|
||||
"mesecons_extrawires:doublecorner_00",
|
||||
"mesecons_extrawires:doublecorner_01",
|
||||
"mesecons_extrawires:doublecorner_10",
|
||||
"mesecons_extrawires:doublecorner_11",
|
||||
}
|
||||
local wire1_states = { "off", "off", "on", "on" }
|
||||
local wire2_states = { "off", "on", "off", "on" }
|
||||
|
||||
for k, state in ipairs(doublecorner_states) do
|
||||
local w1 = wire1_states[k]
|
||||
local w2 = wire2_states[k]
|
||||
local groups = { dig_immediate = 3 }
|
||||
if k ~= 1 then groups.not_in_creative_inventory = 1 end
|
||||
minetest.register_node(state, {
|
||||
drawtype = "mesh",
|
||||
mesh = "mesecons_extrawires_doublecorner.obj",
|
||||
description = "Insulated Mesecon Double Corner",
|
||||
tiles = {
|
||||
{ name = "jeija_insulated_wire_sides_" .. w1 .. ".png", backface_culling = true },
|
||||
{ name = "jeija_insulated_wire_ends_" .. w1 .. ".png", backface_culling = true },
|
||||
{ name = "jeija_insulated_wire_sides_" .. w2 .. ".png", backface_culling = true },
|
||||
{ name = "jeija_insulated_wire_ends_" .. w2 .. ".png", backface_culling = true },
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
selection_box = doublecorner_selectionbox,
|
||||
groups = groups,
|
||||
drop = doublecorner_states[1],
|
||||
sounds = default.node_sound_defaults(),
|
||||
mesecons = {
|
||||
conductor = {
|
||||
states = doublecorner_states,
|
||||
rules = doublecorner_get_rules,
|
||||
},
|
||||
},
|
||||
on_blast = mesecon.on_blastnode,
|
||||
on_rotate = rotate,
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "mesecons_extrawires:doublecorner_00",
|
||||
recipe = {
|
||||
"mesecons_extrawires:corner_off",
|
||||
"mesecons_extrawires:corner_off",
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "mesecons_extrawires:corner_off 2",
|
||||
recipe = {
|
||||
"mesecons_extrawires:doublecorner_00",
|
||||
},
|
||||
})
|
@ -1,5 +1,6 @@
|
||||
dofile(minetest.get_modpath("mesecons_extrawires").."/crossover.lua");
|
||||
dofile(minetest.get_modpath("mesecons_extrawires").."/tjunction.lua");
|
||||
dofile(minetest.get_modpath("mesecons_extrawires").."/corner.lua");
|
||||
dofile(minetest.get_modpath("mesecons_extrawires").."/doublecorner.lua");
|
||||
dofile(minetest.get_modpath("mesecons_extrawires").."/vertical.lua");
|
||||
dofile(minetest.get_modpath("mesecons_extrawires").."/mesewire.lua");
|
||||
|
125
mesecons_extrawires/models/mesecons_extrawires_corner.obj
Normal file
125
mesecons_extrawires/models/mesecons_extrawires_corner.obj
Normal file
@ -0,0 +1,125 @@
|
||||
# Вершины
|
||||
# Провод 1
|
||||
# 1 (ниж. внутр.)
|
||||
v 0.093750 -0.531250 -0.501000
|
||||
v 0.093750 -0.531250 -0.331726
|
||||
v 0.331726 -0.531250 -0.093750
|
||||
v 0.501000 -0.531250 -0.093750
|
||||
# 5 (ниж. наруж.)
|
||||
v -0.093750 -0.531250 -0.501000
|
||||
v -0.093750 -0.531250 -0.254061
|
||||
v 0.254061 -0.531250 0.093750
|
||||
v 0.501000 -0.531250 0.093750
|
||||
# 9 (верх. внутр.)
|
||||
v 0.093750 -0.406250 -0.501000
|
||||
v 0.093750 -0.406250 -0.331726
|
||||
v 0.331726 -0.406250 -0.093750
|
||||
v 0.501000 -0.406250 -0.093750
|
||||
# 13 (верх. наруж.)
|
||||
v -0.093750 -0.406250 -0.501000
|
||||
v -0.093750 -0.406250 -0.254061
|
||||
v 0.254061 -0.406250 0.093750
|
||||
v 0.501000 -0.406250 0.093750
|
||||
# Текстурные координаты
|
||||
# 1 (ниж.)
|
||||
vt 0.000000 0.406250
|
||||
vt 0.168274 0.406250
|
||||
vt 0.331726 0.406250
|
||||
vt 0.668274 0.406250
|
||||
vt 0.831726 0.406250
|
||||
vt 1.000000 0.406250
|
||||
vt 0.000000 0.593750
|
||||
vt 0.245939 0.593750
|
||||
vt 0.254061 0.593750
|
||||
vt 0.745939 0.593750
|
||||
vt 0.754061 0.593750
|
||||
vt 1.000000 0.593750
|
||||
# 13 (верх.)
|
||||
vt 0.000000 0.406250
|
||||
vt 0.245939 0.406250
|
||||
vt 0.254061 0.406250
|
||||
vt 0.745939 0.406250
|
||||
vt 0.754061 0.406250
|
||||
vt 1.000000 0.406250
|
||||
vt 0.000000 0.593750
|
||||
vt 0.168274 0.593750
|
||||
vt 0.331726 0.593750
|
||||
vt 0.668274 0.593750
|
||||
vt 0.831726 0.593750
|
||||
vt 1.000000 0.593750
|
||||
# 25 (внутр.)
|
||||
vt 1.000000 0.093750
|
||||
vt 0.831726 0.093750
|
||||
vt 0.668274 0.093750
|
||||
vt 0.331726 0.093750
|
||||
vt 0.168274 0.093750
|
||||
vt 0.000000 0.093750
|
||||
vt 1.000000 -0.031250
|
||||
vt 0.831726 -0.031250
|
||||
vt 0.668274 -0.031250
|
||||
vt 0.331726 -0.031250
|
||||
vt 0.168274 -0.031250
|
||||
vt 0.000000 -0.031250
|
||||
# 37 (внеш.)
|
||||
vt 0.000000 -0.031250
|
||||
vt 0.245939 -0.031250
|
||||
vt 0.254061 -0.031250
|
||||
vt 0.745939 -0.031250
|
||||
vt 0.754061 -0.031250
|
||||
vt 1.000000 -0.031250
|
||||
vt 0.000000 0.093750
|
||||
vt 0.245939 0.093750
|
||||
vt 0.254061 0.093750
|
||||
vt 0.745939 0.093750
|
||||
vt 0.754061 0.093750
|
||||
vt 1.000000 0.093750
|
||||
# 49 (торец)
|
||||
vt 0.406250 -0.031250
|
||||
vt 0.406250 0.093750
|
||||
vt 0.593750 -0.031250
|
||||
vt 0.593750 0.093750
|
||||
# Нормали
|
||||
# 1
|
||||
vn 1.000000 0.000000 0.000000
|
||||
vn 0.000000 1.000000 0.000000
|
||||
vn 0.000000 0.000000 1.000000
|
||||
vn 0.707107 0.000000 0.707107
|
||||
# 5
|
||||
vn -1.000000 0.000000 0.000000
|
||||
vn 0.000000 -1.000000 0.000000
|
||||
vn 0.000000 0.000000 -1.000000
|
||||
vn -0.707107 0.000000 -0.707107
|
||||
# Грани
|
||||
g Sides1
|
||||
# Часть 1
|
||||
f 5/37/1 6/38/1 14/44/1
|
||||
f 5/37/1 14/44/1 13/43/1
|
||||
f 13/13/2 14/14/2 10/20/2
|
||||
f 13/13/2 10/20/2 9/19/2
|
||||
f 9/25/5 10/26/5 2/32/5
|
||||
f 9/25/5 2/32/5 1/31/5
|
||||
f 1/1/6 2/2/6 6/8/6
|
||||
f 1/1/6 6/8/6 5/7/6
|
||||
# Часть 2
|
||||
f 6/39/4 7/40/4 15/46/4
|
||||
f 6/39/4 15/46/4 14/45/4
|
||||
f 14/15/2 15/16/2 11/22/2
|
||||
f 14/15/2 11/22/2 10/21/2
|
||||
f 10/27/8 11/28/8 3/34/8
|
||||
f 10/27/8 3/34/8 2/33/8
|
||||
f 2/3/6 3/4/6 7/10/6
|
||||
f 2/3/6 7/10/6 6/9/6
|
||||
# Часть 3
|
||||
f 7/41/3 8/42/3 16/48/3
|
||||
f 7/41/3 16/48/3 15/47/3
|
||||
f 15/17/2 16/18/2 12/24/2
|
||||
f 15/17/2 12/24/2 11/23/2
|
||||
f 11/29/7 12/30/7 4/36/7
|
||||
f 11/29/7 4/36/7 3/35/7
|
||||
f 3/5/6 4/6/6 8/12/6
|
||||
f 3/5/6 8/12/6 7/11/6
|
||||
g Ends1
|
||||
f 1/49/3 5/51/3 13/52/3
|
||||
f 1/49/3 13/52/3 9/50/3
|
||||
f 4/49/1 12/50/1 16/52/1
|
||||
f 4/49/1 16/52/1 8/51/1
|
180
mesecons_extrawires/models/mesecons_extrawires_doublecorner.obj
Normal file
180
mesecons_extrawires/models/mesecons_extrawires_doublecorner.obj
Normal file
@ -0,0 +1,180 @@
|
||||
# Вершины
|
||||
# Провод 1
|
||||
# 1 (ниж. внутр.)
|
||||
v 0.093750 -0.531250 -0.501000
|
||||
v 0.093750 -0.531250 -0.331726
|
||||
v 0.331726 -0.531250 -0.093750
|
||||
v 0.501000 -0.531250 -0.093750
|
||||
# 5 (ниж. наруж.)
|
||||
v -0.093750 -0.531250 -0.501000
|
||||
v -0.093750 -0.531250 -0.254061
|
||||
v 0.254061 -0.531250 0.093750
|
||||
v 0.501000 -0.531250 0.093750
|
||||
# 9 (верх. внутр.)
|
||||
v 0.093750 -0.406250 -0.501000
|
||||
v 0.093750 -0.406250 -0.331726
|
||||
v 0.331726 -0.406250 -0.093750
|
||||
v 0.501000 -0.406250 -0.093750
|
||||
# 13 (верх. наруж.)
|
||||
v -0.093750 -0.406250 -0.501000
|
||||
v -0.093750 -0.406250 -0.254061
|
||||
v 0.254061 -0.406250 0.093750
|
||||
v 0.501000 -0.406250 0.093750
|
||||
# Провод 2
|
||||
# 17 (ниж. внутр.)
|
||||
v -0.093750 -0.531250 0.501000
|
||||
v -0.093750 -0.531250 0.331726
|
||||
v -0.331726 -0.531250 0.093750
|
||||
v -0.501000 -0.531250 0.093750
|
||||
# 21 (ниж. наруж.)
|
||||
v 0.093750 -0.531250 0.501000
|
||||
v 0.093750 -0.531250 0.254061
|
||||
v -0.254061 -0.531250 -0.093750
|
||||
v -0.501000 -0.531250 -0.093750
|
||||
# 25 (верх. внутр.)
|
||||
v -0.093750 -0.406250 0.501000
|
||||
v -0.093750 -0.406250 0.331726
|
||||
v -0.331726 -0.406250 0.093750
|
||||
v -0.501000 -0.406250 0.093750
|
||||
# 29 (верх. наруж.)
|
||||
v 0.093750 -0.406250 0.501000
|
||||
v 0.093750 -0.406250 0.254061
|
||||
v -0.254061 -0.406250 -0.093750
|
||||
v -0.501000 -0.406250 -0.093750
|
||||
# Текстурные координаты
|
||||
# 1 (ниж.)
|
||||
vt 0.000000 0.406250
|
||||
vt 0.168274 0.406250
|
||||
vt 0.331726 0.406250
|
||||
vt 0.668274 0.406250
|
||||
vt 0.831726 0.406250
|
||||
vt 1.000000 0.406250
|
||||
vt 0.000000 0.593750
|
||||
vt 0.245939 0.593750
|
||||
vt 0.254061 0.593750
|
||||
vt 0.745939 0.593750
|
||||
vt 0.754061 0.593750
|
||||
vt 1.000000 0.593750
|
||||
# 13 (верх.)
|
||||
vt 0.000000 0.406250
|
||||
vt 0.245939 0.406250
|
||||
vt 0.254061 0.406250
|
||||
vt 0.745939 0.406250
|
||||
vt 0.754061 0.406250
|
||||
vt 1.000000 0.406250
|
||||
vt 0.000000 0.593750
|
||||
vt 0.168274 0.593750
|
||||
vt 0.331726 0.593750
|
||||
vt 0.668274 0.593750
|
||||
vt 0.831726 0.593750
|
||||
vt 1.000000 0.593750
|
||||
# 25 (внутр.)
|
||||
vt 1.000000 0.093750
|
||||
vt 0.831726 0.093750
|
||||
vt 0.668274 0.093750
|
||||
vt 0.331726 0.093750
|
||||
vt 0.168274 0.093750
|
||||
vt 0.000000 0.093750
|
||||
vt 1.000000 -0.031250
|
||||
vt 0.831726 -0.031250
|
||||
vt 0.668274 -0.031250
|
||||
vt 0.331726 -0.031250
|
||||
vt 0.168274 -0.031250
|
||||
vt 0.000000 -0.031250
|
||||
# 37 (внеш.)
|
||||
vt 0.000000 -0.031250
|
||||
vt 0.245939 -0.031250
|
||||
vt 0.254061 -0.031250
|
||||
vt 0.745939 -0.031250
|
||||
vt 0.754061 -0.031250
|
||||
vt 1.000000 -0.031250
|
||||
vt 0.000000 0.093750
|
||||
vt 0.245939 0.093750
|
||||
vt 0.254061 0.093750
|
||||
vt 0.745939 0.093750
|
||||
vt 0.754061 0.093750
|
||||
vt 1.000000 0.093750
|
||||
# 49 (торец)
|
||||
vt 0.406250 -0.031250
|
||||
vt 0.406250 0.093750
|
||||
vt 0.593750 -0.031250
|
||||
vt 0.593750 0.093750
|
||||
# Нормали
|
||||
# 1
|
||||
vn 1.000000 0.000000 0.000000
|
||||
vn 0.000000 1.000000 0.000000
|
||||
vn 0.000000 0.000000 1.000000
|
||||
vn 0.707107 0.000000 0.707107
|
||||
# 5
|
||||
vn -1.000000 0.000000 0.000000
|
||||
vn 0.000000 -1.000000 0.000000
|
||||
vn 0.000000 0.000000 -1.000000
|
||||
vn -0.707107 0.000000 -0.707107
|
||||
# Грани
|
||||
# Грани
|
||||
g Sides1
|
||||
# Часть 1
|
||||
f 5/37/1 6/38/1 14/44/1
|
||||
f 5/37/1 14/44/1 13/43/1
|
||||
f 13/13/2 14/14/2 10/20/2
|
||||
f 13/13/2 10/20/2 9/19/2
|
||||
f 9/25/5 10/26/5 2/32/5
|
||||
f 9/25/5 2/32/5 1/31/5
|
||||
f 1/1/6 2/2/6 6/8/6
|
||||
f 1/1/6 6/8/6 5/7/6
|
||||
# Часть 2
|
||||
f 6/39/4 7/40/4 15/46/4
|
||||
f 6/39/4 15/46/4 14/45/4
|
||||
f 14/15/2 15/16/2 11/22/2
|
||||
f 14/15/2 11/22/2 10/21/2
|
||||
f 10/27/8 11/28/8 3/34/8
|
||||
f 10/27/8 3/34/8 2/33/8
|
||||
f 2/3/6 3/4/6 7/10/6
|
||||
f 2/3/6 7/10/6 6/9/6
|
||||
# Часть 3
|
||||
f 7/41/3 8/42/3 16/48/3
|
||||
f 7/41/3 16/48/3 15/47/3
|
||||
f 15/17/2 16/18/2 12/24/2
|
||||
f 15/17/2 12/24/2 11/23/2
|
||||
f 11/29/7 12/30/7 4/36/7
|
||||
f 11/29/7 4/36/7 3/35/7
|
||||
f 3/5/6 4/6/6 8/12/6
|
||||
f 3/5/6 8/12/6 7/11/6
|
||||
g Ends1
|
||||
f 1/49/3 5/51/3 13/52/3
|
||||
f 1/49/3 13/52/3 9/50/3
|
||||
f 4/49/1 12/50/1 16/52/1
|
||||
f 4/49/1 16/52/1 8/51/1
|
||||
g Sides2
|
||||
# Часть 1
|
||||
f 21/37/1 22/38/1 30/44/1
|
||||
f 21/37/1 30/44/1 29/43/1
|
||||
f 29/13/2 30/14/2 26/20/2
|
||||
f 29/13/2 26/20/2 25/19/2
|
||||
f 25/25/5 26/26/5 18/32/5
|
||||
f 25/25/5 18/32/5 17/31/5
|
||||
f 17/1/6 18/2/6 22/8/6
|
||||
f 17/1/6 22/8/6 21/7/6
|
||||
# Часть 2
|
||||
f 22/39/4 23/40/4 31/46/4
|
||||
f 22/39/4 31/46/4 30/45/4
|
||||
f 30/15/2 31/16/2 27/22/2
|
||||
f 30/15/2 27/22/2 26/21/2
|
||||
f 26/27/8 27/28/8 19/34/8
|
||||
f 26/27/8 19/34/8 18/33/8
|
||||
f 18/3/6 19/4/6 23/10/6
|
||||
f 18/3/6 23/10/6 22/9/6
|
||||
# Часть 3
|
||||
f 23/41/3 24/42/3 32/48/3
|
||||
f 23/41/3 32/48/3 31/47/3
|
||||
f 31/17/2 32/18/2 28/24/2
|
||||
f 31/17/2 28/24/2 27/23/2
|
||||
f 27/29/7 28/30/7 20/36/7
|
||||
f 27/29/7 20/36/7 19/35/7
|
||||
f 19/5/6 20/6/6 24/12/6
|
||||
f 19/5/6 24/12/6 23/11/6
|
||||
g Ends2
|
||||
f 17/49/3 21/51/3 29/52/3
|
||||
f 17/49/3 29/52/3 25/50/3
|
||||
f 20/49/1 28/50/1 32/52/1
|
||||
f 20/49/1 32/52/1 24/51/1
|
Binary file not shown.
Before Width: | Height: | Size: 136 B |
Binary file not shown.
Before Width: | Height: | Size: 136 B |
Loading…
Reference in New Issue
Block a user