1
0
Fork 0

Fix the partially non-pointable fences

This was caused by incorrect ordering of nodebox boundaries (bigger value was first sometimes)
This commit is contained in:
Wuzzy 2017-05-19 14:22:06 +02:00
parent 5907d43179
commit c46cdb67c0
1 changed files with 33 additions and 33 deletions

View File

@ -1,22 +1,22 @@
local init = os.clock()
-- Node box
local p = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}
local x1 = {-2/16, 1/2-4/16, 1/16, -1/2, 1/2-1/16, -1/16} --oben(quer) -x
local x12 = {-2/16, -1/2+6/16, 1/16, -1/2, -1/2+9/16, -1/16} --unten(quer) -x
local x2 = {2/16, 1/2-4/16, -1/16, 1/2, 1/2-1/16, 1/16} --oben(quer) x
local x22 = {2/16, -1/2+6/16, -1/16, 1/2, -1/2+9/16, 1/16} --unten(quer) x
local z1 = {1/16, 1/2-4/16, -2/16, -1/16, 1/2-1/16, -1/2} --oben(quer) -z
local z12 = {1/16, -1/2+6/16, -2/16, -1/16, -1/2+9/16, -1/2} --unten(quer) -z
local z2 = {-1/16, 1/2-4/16, 2/16, 1/16, 1/2-1/16, 1/2} --oben(quer) z
local z22 = {-1/16, -1/2+6/16, 2/16, 1/16, -1/2+9/16, 1/2} --unten(quer) z
local p = {-2/16, -0.5, -2/16, 2/16, 0.5, 2/16}
local x1 = {-0.5, 4/16, -1/16, -2/16, 7/16, 1/16} --oben(quer) -x
local x12 = {-0.5, -2/16, -1/16, -2/16, 1/16, 1/16} --unten(quer) -x
local x2 = {2/16, 4/16, -1/16, 0.5, 7/16, 1/16} --oben(quer) x
local x22 = {2/16, -2/16, -1/16, 0.5, 1/16, 1/16} --unten(quer) x
local z1 = {-1/16, 4/16, -0.5, 1/16, 7/16, -2/16} --oben(quer) -z
local z12 = {-1/16, -2/16, -0.5, 1/16, 1/16, -2/16} --unten(quer) -z
local z2 = {-1/16, 4/16, 2/16, 1/16, 7/16, 0.5} --oben(quer) z
local z22 = {-1/16, -2/16, 2/16, 1/16, 1/16, 0.5} --unten(quer) z
-- Collision box
local cp = {-2/16, -1/2, -2/16, 2/16, 1, 2/16}
local cx1 = {-2/16, -1/2+6/16, 2/16, -1/2, 1, -2/16} --unten(quer) -x
local cx2 = {2/16, -1/2+6/16, -2/16, 1/2, 1, 2/16} --unten(quer) x
local cz1 = {2/16, -1/2+6/16, -2/16, -2/16, 1, -1/2} --unten(quer) -z
local cz2 = {-2/16, -1/2+6/16, 2/16, 2/16, 1, 1/2} --unten(quer) z
local cp = {-2/16, -0.5, -2/16, 2/16, 1, 2/16}
local cx1 = {-0.5, -2/16, -2/16, -2/16, 1, 2/16} --unten(quer) -x
local cx2 = {2/16, -2/16, -2/16, 0.5, 1, 2/16} --unten(quer) x
local cz1 = {-2/16, -2/16, -0.5, 2/16, 1, -2/16} --unten(quer) -z
local cz2 = {-2/16, -2/16, 2/16, 2/16, 1, 0.5} --unten(quer) z
mcl_fences = {}
@ -133,20 +133,20 @@ mcl_fences.register_fence_gate = function(id, fence_gate_name, texture, groups,
node_box = {
type = "fixed",
fixed = {
{-1/2, -1/2+5/16, -1/16, -1/2+2/16, 1/2, 1/16}, --links abschluss
{1/2-2/16, -1/2+5/16, -1/16, 1/2, 1/2, 1/16}, --rechts abschluss
{-1/2, 1/2-4/16, 1/16, -1/2+2/16, 1/2-1/16, 1/2-2/16}, --oben-links(quer) x
{-1/2, -1/2+6/16, 1/16, -1/2+2/16, -1/2+9/16, 1/2-2/16}, --unten-links(quer) x
{1/2-2/16, 1/2-4/16, 1/16, 1/2, 1/2-1/16, 1/2}, --oben-rechts(quer) x
{1/2-2/16, -1/2+6/16, 1/16, 1/2, -1/2+9/16, 1/2}, --unten-rechts(quer) x
{-1/2, -1/2+6/16, 6/16, -1/2+2/16, 1/2-1/16, 1/2}, --mitte links
{1/2-2/16, 1/2-4/16, 1/2, 1/2, -1/2+9/16, 6/16}, --mitte rechts
{-0.5, -3/16, -1/16, -6/16, 0.5, 1/16}, --links abschluss
{6/16, -3/16, -1/16, 0.5, 0.5, 1/16}, --rechts abschluss
{-0.5, 4/16, 1/16, -6/16, 7/16, 6/16}, --oben-links(quer) x
{-0.5, -2/16, 1/16, -6/16, 1/16, 6/16}, --unten-links(quer) x
{6/16, 4/16, 1/16, 0.5, 7/16, 0.5}, --oben-rechts(quer) x
{6/16, -2/16, 1/16, 0.5, 1/16, 0.5}, --unten-rechts(quer) x
{-0.5, -2/16, 6/16, -6/16, 7/16, 0.5}, --mitte links
{6/16, 1/16, 0.5, 0.5, 4/16, 6/16}, --mitte rechts
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, -1/2+5/16, -1/16, 1/2, 1/2, 1/16}, --gate
{-0.5, -3/16, -1/16, 0.5, 0.5, 1/16}, --gate
}
},
on_rightclick = function(pos, node, clicker)
@ -183,26 +183,26 @@ mcl_fences.register_fence_gate = function(id, fence_gate_name, texture, groups,
node_box = {
type = "fixed",
fixed = {
{-1/2, -1/2+5/16, -1/16, -1/2+2/16, 1/2, 1/16}, --links abschluss
{1/2-2/16, -1/2+5/16, -1/16, 1/2, 1/2, 1/16}, --rechts abschluss
{-2/16, -1/2+6/16, -1/16, 0, 1/2-1/16, 1/16}, --mitte links
{0, -1/2+6/16, -1/16, 2/16, 1/2-1/16, 1/16}, --mitte rechts
{-2/16, 1/2-4/16, 1/16, -1/2, 1/2-1/16, -1/16}, --oben(quer) -z
{-2/16, -1/2+6/16, 1/16, -1/2, -1/2+9/16, -1/16}, --unten(quer) -z
{2/16, 1/2-4/16, -1/16, 1/2, 1/2-1/16, 1/16}, --oben(quer) z
{2/16, -1/2+6/16, -1/16, 1/2, -1/2+9/16, 1/16}, --unten(quer) z
{-0.5, -3/16, -1/16, -6/16, 0.5, 1/16}, --links abschluss
{6/16, -3/16, -1/16, 0.5, 0.5, 1/16}, --rechts abschluss
{-2/16, -2/16, -1/16, 0, 7/16, 1/16}, --mitte links
{0, -2/16, -1/16, 2/16, 7/16, 1/16}, --mitte rechts
{-0.5, 4/16, -1/16, -2/16, 7/16, 1/16}, --oben(quer) -z
{-0.5, -2/16, -1/16, -2/16, 1/16, 1/16}, --unten(quer) -z
{2/16, 4/16, -1/16, 0.5, 7/16, 1/16}, --oben(quer) z
{2/16, -2/16, -1/16, 0.5, 1/16, 1/16}, --unten(quer) z
}
},
collision_box = {
type = "fixed",
fixed = {
{-1/2, -1/2+5/16, -2/16, 1/2, 1, 2/16}, --gate
{-0.5, -3/16, -2/16, 0.5, 1, 2/16}, --gate
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, -1/2+5/16, -1/16, 1/2, 1/2, 1/16}, --gate
{-0.5, -3/16, -1/16, 0.5, 0.5, 1/16}, --gate
}
},
on_construct = function(pos)