Skip to content

Commit

Permalink
Remove tiny (+0.001) selection box oversize
Browse files Browse the repository at this point in the history
  • Loading branch information
numberZero authored and sfan5 committed Sep 7, 2018
1 parent 9e6eac4 commit a4f5ae5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion mesecons_extrawires/corner.lua
Expand Up @@ -2,13 +2,14 @@ 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-0.001, -16/32, -16/32, 5/32, -12/32, 5/32 },
fixed = { -16/32, -16/32, -16/32, 5/32, -12/32, 5/32 },
}

local corner_get_rules = function (node)
Expand Down
8 changes: 4 additions & 4 deletions mesecons_extrawires/crossover.lua
Expand Up @@ -32,7 +32,7 @@ minetest.register_node("mesecons_extrawires:crossover_off", {
is_ground_content = false,
walkable = false,
stack_max = 99,
selection_box = {type="fixed", fixed={-16/32-0.0001, -16/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
selection_box = {type="fixed", fixed={-16/32, -16/32, -16/32, 16/32, -5/32, 16/32}},
groups = {dig_immediate=3, mesecon=3},
sounds = default.node_sound_defaults(),
mesecons = {
Expand All @@ -59,7 +59,7 @@ minetest.register_node("mesecons_extrawires:crossover_01", {
is_ground_content = false,
walkable = false,
stack_max = 99,
selection_box = {type="fixed", fixed={-16/32-0.0001, -16/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
selection_box = {type="fixed", fixed={-16/32, -16/32, -16/32, 16/32, -5/32, 16/32}},
groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
mesecons = {
Expand All @@ -86,7 +86,7 @@ minetest.register_node("mesecons_extrawires:crossover_10", {
is_ground_content = false,
walkable = false,
stack_max = 99,
selection_box = {type="fixed", fixed={-16/32-0.0001, -16/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
selection_box = {type="fixed", fixed={-16/32, -16/32, -16/32, 16/32, -5/32, 16/32}},
groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
mesecons = {
Expand All @@ -113,7 +113,7 @@ minetest.register_node("mesecons_extrawires:crossover_on", {
is_ground_content = false,
walkable = false,
stack_max = 99,
selection_box = {type="fixed", fixed={-16/32-0.0001, -16/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
selection_box = {type="fixed", fixed={-16/32, -16/32, -16/32, 16/32, -5/32, 16/32}},
groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
mesecons = {
Expand Down
3 changes: 2 additions & 1 deletion mesecons_extrawires/tjunction.lua
Expand Up @@ -2,13 +2,14 @@ local screwdriver_exists = minetest.global_exists("screwdriver")

local tjunction_nodebox = {
type = "fixed",
-- ±0.001 is to prevent z-fighting
fixed = {{ -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 },
{ -3/32, -17/32, -16/32+0.001, 3/32, -13/32, -3/32},}
}

local tjunction_selectionbox = {
type = "fixed",
fixed = { -16/32-0.001, -16/32, -16/32, 16/32+0.001, -12/32, 7/32 },
fixed = { -16/32, -16/32, -16/32, 16/32, -12/32, 7/32 },
}

local tjunction_get_rules = function (node)
Expand Down
6 changes: 4 additions & 2 deletions mesecons_insulated/init.lua
Expand Up @@ -27,10 +27,11 @@ minetest.register_node("mesecons_insulated:insulated_on", {
sunlight_propagates = true,
selection_box = {
type = "fixed",
fixed = { -16/32-0.001, -16/32, -7/32, 16/32+0.001, -12/32, 7/32 }
fixed = { -16/32, -16/32, -7/32, 16/32, -12/32, 7/32 }
},
node_box = {
type = "fixed",
-- ±0.001 is to prevent z-fighting
fixed = { -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 }
},
groups = {dig_immediate = 3, not_in_creative_inventory = 1},
Expand Down Expand Up @@ -63,10 +64,11 @@ minetest.register_node("mesecons_insulated:insulated_off", {
sunlight_propagates = true,
selection_box = {
type = "fixed",
fixed = { -16/32-0.001, -16/32, -7/32, 16/32+0.001, -12/32, 7/32 }
fixed = { -16/32, -16/32, -7/32, 16/32, -12/32, 7/32 }
},
node_box = {
type = "fixed",
-- ±0.001 is to prevent z-fighting
fixed = { -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 }
},
groups = {dig_immediate = 3},
Expand Down

0 comments on commit a4f5ae5

Please sign in to comment.