use mesh node for traffic cone

This commit is contained in:
Vanessa Dannenberg 2018-09-28 02:17:42 -04:00
parent 78b0d22908
commit a62e29300e
6 changed files with 4202 additions and 67 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1349,91 +1349,46 @@
end end
-- Traffic cone -- Traffic cone
local cbox = {
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0.4065, 0.25 }
}
minetest.register_node("infrastructure:traffic_cone", { minetest.register_node("infrastructure:traffic_cone", {
description = "Traffic cone", description = "Traffic cone",
tiles = { tiles = { "infrastructure_traffic_cone.png" },
"infrastructure_traffic_cone_top.png", drawtype = "mesh",
"infrastructure_traffic_cone_bottom.png", mesh = "infrastructure_traffic_cone.obj",
"infrastructure_traffic_cone_side.png",
"infrastructure_traffic_cone_side.png",
"infrastructure_traffic_cone_side.png",
"infrastructure_traffic_cone_side.png"
},
drawtype = "nodebox",
paramtype = "light", paramtype = "light",
groups = {cracky = 2}, groups = {cracky = 2},
walkable = false, walkable = false,
light_source = ENERGY_ABSORBING_TERMINAL_LIGHT_RANGE, light_source = ENERGY_ABSORBING_TERMINAL_LIGHT_RANGE,
node_box = { collision_box = cbox,
type = "fixed", selection_box = cbox,
fixed = {
{-1/4, -1/2, 0, 1/4, 1/4, 0},
{0, -1/2, -1/4, 0, 1/4, 1/4},
{-3/8, -1/2, -1/8, 3/8, -3/8, 1/8},
{-1/8, -1/2, -3/8, 1/8, -3/8, 3/8},
{-3/8, -1/2 + 0.001, -3/8, 3/8, -1/2 + 0.001, 3/8}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/4, -1/2, 0, 1/4, 1/4, 0},
{0, -1/2, -1/4, 0, 1/4, 1/4},
{-3/8, -1/2, -1/8, 3/8, -3/8, 1/8},
{-1/8, -1/2, -3/8, 1/8, -3/8, 3/8},
{-3/8, -1/2 + 0.001, -3/8, 3/8, -1/2 + 0.001, 3/8}
}
},
after_place_node = function(pos, placer) after_place_node = function(pos, placer)
displacement(pos, placer) displacement(pos, placer)
end end
}) })
for i = 1, 3 do for i = 1, 3 do
local cbox = {
type = "fixed",
fixed = { -0.25, -0.5 - i/4, -0.25, 0.25, 0.4065 - i/4, 0.25 }
}
minetest.register_node("infrastructure:traffic_cone_displacement_"..tostring(i), { minetest.register_node("infrastructure:traffic_cone_displacement_"..tostring(i), {
tiles = { tiles = { "infrastructure_traffic_cone.png" },
"infrastructure_traffic_cone_top.png", drawtype = "mesh",
"infrastructure_traffic_cone_bottom.png", mesh = "infrastructure_traffic_cone_i"..i..".obj",
"[combine:32x32:0,"..tostring(i * 8).."=infrastructure_traffic_cone_side.png:0,"..tostring(i * 8 - 32).."=infrastructure_traffic_cone_side.png",
"[combine:32x32:0,"..tostring(i * 8).."=infrastructure_traffic_cone_side.png:0,"..tostring(i * 8 - 32).."=infrastructure_traffic_cone_side.png",
"[combine:32x32:0,"..tostring(i * 8).."=infrastructure_traffic_cone_side.png:0,"..tostring(i * 8 - 32).."=infrastructure_traffic_cone_side.png",
"[combine:32x32:0,"..tostring(i * 8).."=infrastructure_traffic_cone_side.png:0,"..tostring(i * 8 - 32).."=infrastructure_traffic_cone_side.png"
},
drawtype = "nodebox",
paramtype = "light", paramtype = "light",
groups = {cracky = 2, not_in_creative_inventory = 1}, groups = {cracky = 2, not_in_creative_inventory = 1},
walkable = false, walkable = false,
light_source = ENERGY_ABSORBING_TERMINAL_LIGHT_RANGE, light_source = ENERGY_ABSORBING_TERMINAL_LIGHT_RANGE,
drop = "infrastructure:traffic_cone", drop = "infrastructure:traffic_cone",
node_box = { collision_box = cbox,
type = "fixed", selection_box = cbox,
fixed = {
{-1/4, -1/2 - i/4, 0, 1/4, 1/4 - i/4, 0},
{0, -1/2 - i/4, -1/4, 0, 1/4 - i/4, 1/4},
{-3/8, -1/2 - i/4, -1/8, 3/8, -3/8 - i/4, 1/8},
{-1/8, -1/2 - i/4, -3/8, 1/8, -3/8 - i/4, 3/8},
{-3/8, -1/2 + 0.001 - i/4, -3/8, 3/8, -1/2 + 0.001 - i/4, 3/8}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/4, -1/2 - i/4, 0, 1/4, 1/4 - i/4, 0},
{0, -1/2 - i/4, -1/4, 0, 1/4 - i/4, 1/4},
{-3/8, -1/2 - i/4, -1/8, 3/8, -3/8 - i/4, 1/8},
{-1/8, -1/2 - i/4, -3/8, 1/8, -3/8 - i/4, 3/8},
{-3/8, -1/2 + 0.001 - i/4, -3/8, 3/8, -1/2 + 0.001 - i/4, 3/8}
}
}
}) })
end end

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB