-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add insulated double corner * Make single corner curved to match double corner * Remove obsolete regular corner textures
- Loading branch information
1 parent
4750925
commit 9fda51b
Showing
7 changed files
with
405 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 125 additions & 0 deletions
125
mesecons_extrawires/models/mesecons_extrawires_corner.obj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# Вершины | ||
# Провод 1 | ||
# 1 (ниж. внутр.) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
numberZero
Author
Contributor
|
||
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 |
Oops, something went wrong.
😬😁