fix orientation checks

(broke at the 31-color update)
This commit is contained in:
Vanessa Dannenberg 2018-08-15 14:27:55 -04:00
parent 7e4e738c99
commit 06d19f0d2e
2 changed files with 41 additions and 38 deletions

@ -10,11 +10,6 @@ else
S = function(s) return s end
end
local marquee_cbox = {
type = "fixed",
fixed = { -16/32, -8/16, -16/32, 16/32, 8/16, -15/32 }
}
-- the following functions based on the so-named ones in Jeija's digilines mod
local reset_meta = function(pos)
@ -34,10 +29,19 @@ end
-- the nodes:
local fdir_to_right = {
{ 1, 0 },
{ 0, -1 },
{ -1, 0 },
{ 0, -1 },
{ 0, 1 },
{ 0, -1 },
{ 1, 0 },
{ -1, 0 },
}
local cbox = {
type = "wallmounted",
wall_top = { -8/16, 7/16, -8/16, 8/16, 8/16, 8/16 },
wall_bottom = { -8/16, -8/16, -8/16, 8/16, -7/16, 8/16 },
wall_side = { -8/16, -8/16, -8/16, -7/16, 8/16, 8/16 }
}
local padding = " "
@ -66,7 +70,6 @@ local display_string = function(pos, channel, string)
local node = minetest.get_node(pos2)
local meta = minetest.get_meta(pos2)
local setchan = meta:get_string("channel")
if not string.match(node.name, "led_marquee:char_") or (setchan ~= nil and setchan ~= "" and setchan ~= channel) then break end
local asc = string.byte(padded_string, i, i)
if (node.param2 % 8) == fdir and asc > 31 and asc < 130 then
@ -167,8 +170,8 @@ for i = 32, 129 do
paramtype = "light",
paramtype2 = "colorwallmounted",
light_source = light,
selection_box = marquee_cbox,
collision_box = marquee_cbox,
selection_box = cbox,
node_box = cbox,
on_construct = function(pos)
reset_meta(pos)
end,

@ -1,30 +1,30 @@
# Blender v2.79 (sub 0) OBJ File: 'LED marquee.blend'
# www.blender.org
o Cube_Cube_LEDs
v -0.453125 -0.500000 -0.468750
v -0.453125 0.500000 -0.468750
v -0.453125 0.500000 0.468750
v -0.453125 -0.500000 0.468750
v -0.437500 -0.500000 -0.500000
v -0.437500 -0.500000 -0.484375
v -0.453125 -0.500000 -0.468750
v -0.453125 -0.500000 0.468750
v -0.437500 -0.500000 0.484375
v -0.437500 -0.500000 0.500000
v 0.500000 -0.453125 -0.468750
v -0.500000 -0.453125 -0.468750
v -0.500000 -0.453125 0.468750
v 0.500000 -0.453125 0.468750
v 0.500000 -0.437500 -0.500000
v 0.500000 -0.437500 -0.484375
v 0.500000 -0.453125 -0.468750
v 0.500000 -0.453125 0.468750
v 0.500000 -0.437500 0.484375
v 0.500000 -0.437500 0.500000
v 0.500000 -0.500000 0.500000
v 0.500000 -0.500000 -0.500000
v -0.500000 -0.500000 0.500000
v -0.500000 -0.500000 -0.500000
v -0.500000 0.500000 0.500000
v -0.500000 0.500000 -0.500000
v -0.437500 0.500000 0.500000
v -0.437500 0.500000 0.484375
v -0.453125 0.500000 0.468750
v -0.453125 0.500000 -0.468750
v -0.437500 0.500000 -0.484375
v -0.437500 0.500000 -0.500000
v -0.449125 -0.500000 -0.468750
v -0.449125 0.500000 -0.468750
v -0.449125 0.500000 0.468750
v -0.449125 -0.500000 0.468750
v -0.500000 -0.437500 0.500000
v -0.500000 -0.437500 0.484375
v -0.500000 -0.453125 0.468750
v -0.500000 -0.453125 -0.468750
v -0.500000 -0.437500 -0.484375
v -0.500000 -0.437500 -0.500000
v 0.500000 -0.449125 -0.468750
v -0.500000 -0.449125 -0.468750
v -0.500000 -0.449125 0.468750
v 0.500000 -0.449125 0.468750
vt 0.667843 0.000000
vt 0.667843 0.015513
vt 0.681855 0.031026
@ -73,14 +73,14 @@ vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vn 1.0000 0.0000 -0.0000
vn 0.0000 -1.0000 0.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 1.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn -1.0000 0.0000 0.0000
vn -0.0000 -0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 1.0000 0.0000 0.0000
vn 0.7071 0.0000 -0.7071
vn 0.7071 0.0000 0.7071
vn -0.0000 1.0000 0.0000
vn -0.0000 0.7071 -0.7071
vn -0.0000 0.7071 0.7071
g Cube_Cube_LEDs_Cube_Cube_LEDs_base
s off
f 5/1/1 6/2/1 7/3/1 8/4/1 9/5/1 10/6/1 11/7/1 12/8/1