From 8e1670e3b97c687366dcae3baee5ba6dcc56700b Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Mon, 11 May 2015 12:37:49 -0400 Subject: [PATCH] use mesh node for round-cornered ("small") rugs, nodebox for square-cornered ("large", "persian") rugs. --- homedecor/misc-nodes.lua | 51 +++-- homedecor/models/homedecor_small_rug.obj | 241 +++++++++++++++++++++ homedecor/textures/homedecor_rug_small.png | Bin 1303 -> 1079 bytes 3 files changed, 278 insertions(+), 14 deletions(-) create mode 100644 homedecor/models/homedecor_small_rug.obj diff --git a/homedecor/misc-nodes.lua b/homedecor/misc-nodes.lua index 5e83a353..c7714cab 100644 --- a/homedecor/misc-nodes.lua +++ b/homedecor/misc-nodes.lua @@ -24,21 +24,44 @@ homedecor.register("ceiling_tile", { selection_box = { type = "wallmounted" }, }) -local rug_types = {"small", "large", "persian"} +local rug_types = { + { "small", "homedecor_small_rug.obj" }, + { "large", { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 } }, + { "persian", { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 } } +} -for _, s in ipairs(rug_types) do -homedecor.register("rug_"..s, { - description = S("Throw Rug ("..s..")"), - drawtype = 'signlike', - tiles = {"homedecor_rug_"..s..".png"}, - wield_image = "homedecor_rug_"..s..".png", - inventory_image = "homedecor_rug_"..s..".png", - paramtype2 = "wallmounted", - walkable = false, - groups = {snappy = 3}, - sounds = default.node_sound_leaves_defaults(), - selection_box = { type = "wallmounted" }, -}) +for i in ipairs(rug_types) do + s = rug_types[i][1] + m = rug_types[i][2] + + local mesh = m + local nodebox = nil + local tiles = { "homedecor_rug_"..s..".png", "wool_grey.png" } + + if type(m) == "table" then + mesh = nil + nodebox = { + type = "fixed", + fixed = m + } + tiles = { + "homedecor_rug_"..s..".png", + "wool_grey.png", + "homedecor_rug_"..s..".png" + } + end + + homedecor.register("rug_"..s, { + description = S("Rug ("..s..")"), + mesh = mesh, + tiles = tiles, + node_box = nodebox, + paramtype2 = "wallmounted", + walkable = false, + groups = {snappy = 3}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { type = "wallmounted" }, + }) end local pot_colors = {"black", "green", "terracotta"} diff --git a/homedecor/models/homedecor_small_rug.obj b/homedecor/models/homedecor_small_rug.obj new file mode 100644 index 00000000..16c689ff --- /dev/null +++ b/homedecor/models/homedecor_small_rug.obj @@ -0,0 +1,241 @@ +# Blender v2.73 (sub 0) OBJ File: 'small-rug.blend' +# www.blender.org +o Cylinder +v -0.000000 -0.437500 0.000000 +v 0.323112 -0.437500 0.405968 +v -0.491090 -0.449921 -0.245545 +v -0.491090 -0.500000 0.245545 +v 0.245545 -0.449921 -0.491090 +v -0.245545 -0.500000 -0.491090 +v 0.491090 -0.449921 0.245545 +v 0.491090 -0.500000 -0.245545 +v -0.245545 -0.449921 0.491090 +v 0.245545 -0.500000 0.491090 +v -0.491090 -0.449921 0.245545 +v -0.491090 -0.500000 -0.245545 +v -0.245545 -0.449921 -0.491090 +v 0.245545 -0.500000 -0.491090 +v 0.491090 -0.449921 -0.245545 +v 0.491090 -0.500000 0.245545 +v 0.245545 -0.449921 0.491090 +v -0.245545 -0.500000 0.491090 +v -0.451076 -0.449921 -0.359013 +v -0.451076 -0.500000 0.359013 +v 0.359013 -0.449921 -0.451076 +v -0.359013 -0.500000 -0.451076 +v 0.451076 -0.449921 0.359013 +v 0.451076 -0.500000 -0.359013 +v -0.359013 -0.449921 0.451076 +v 0.359013 -0.500000 0.451076 +v 0.405968 -0.437500 -0.323112 +v -0.323112 -0.437500 -0.405968 +v -0.405968 -0.437500 0.323112 +v -0.323112 -0.437500 0.405968 +v 0.405968 -0.437500 0.323112 +v 0.323112 -0.437500 -0.405968 +v -0.405968 -0.437500 -0.323112 +v 0.220990 -0.437500 0.441981 +v 0.441981 -0.437500 -0.220990 +v -0.220990 -0.437500 -0.441981 +v -0.441981 -0.437500 0.220990 +v -0.220990 -0.437500 0.441981 +v 0.441981 -0.437500 0.220990 +v 0.220990 -0.437500 -0.441981 +v -0.441981 -0.437500 -0.220990 +v -0.000000 -0.500000 -0.000000 +v -0.451076 -0.449921 0.359013 +v -0.451076 -0.500000 -0.359013 +v -0.359013 -0.449921 -0.451076 +v 0.359013 -0.500000 -0.451076 +v 0.451076 -0.449921 -0.359013 +v 0.451076 -0.500000 0.359013 +v 0.359013 -0.449921 0.451076 +v -0.359013 -0.500000 0.451076 +vt 1.000000 0.125000 +vt 1.000000 0.250000 +vt 0.937500 0.250000 +vt 0.937500 0.125000 +vt 0.875000 1.000000 +vt 0.750000 1.000000 +vt 0.750000 0.937500 +vt 0.875000 0.937500 +vt 0.125000 0.000000 +vt 0.250000 0.000000 +vt 0.250000 0.062500 +vt 0.125000 0.062500 +vt 0.865527 0.959260 +vt 0.725000 0.950000 +vt 0.828974 0.913334 +vt 0.000000 0.750000 +vt 0.000000 0.625000 +vt 0.062500 0.625000 +vt 0.062500 0.750000 +vt 0.375000 0.000000 +vt 0.375000 0.062500 +vt 1.000000 0.375000 +vt 0.937500 0.375000 +vt 0.625000 1.000000 +vt 0.625000 0.937500 +vt -0.000000 0.125000 +vt 0.062500 0.125000 +vt 0.062500 0.687500 +vt -0.000000 0.687500 +vt 0.040740 0.134473 +vt 0.134473 0.040740 +vt 0.171026 0.086666 +vt 0.086666 0.171026 +vt 0.875000 0.000000 +vt 0.875000 0.062500 +vt 1.000000 0.875000 +vt 0.937500 0.875000 +vt 0.125000 1.000000 +vt 0.125000 0.937500 +vt 0.000000 1.000000 +vt 0.000000 0.937500 +vt 1.000000 1.000000 +vt 0.937500 1.000000 +vt 1.000000 0.000000 +vt 1.000000 0.062500 +vt -0.000000 0.000000 +vt 0.062500 0.000000 +vt 0.000000 0.875000 +vt 0.062500 0.875000 +vt 0.040740 0.865527 +vt 0.050000 0.725000 +vt 0.086666 0.828974 +vt 0.750000 0.000000 +vt 0.725000 0.050000 +vt 0.275000 0.050000 +vt 1.000000 0.750000 +vt 0.950000 0.725000 +vt 0.950000 0.275000 +vt 0.250000 1.000000 +vt 0.275000 0.950000 +vt 0.000000 0.250000 +vt 0.050000 0.275000 +vt 0.865527 0.040740 +vt 0.828974 0.086666 +vt 0.959260 0.865527 +vt 0.913334 0.828974 +vt 0.134473 0.959260 +vt 0.171026 0.913334 +vt 0.959260 0.134473 +vt 0.913334 0.171026 +vt 0.500000 0.500000 +vn 0.432600 0.587800 -0.683600 +vn 0.683600 0.587800 -0.432600 +vn 0.635200 -0.660500 -0.400200 +vn 0.400200 -0.660500 -0.635200 +vn 0.683600 0.587800 0.432600 +vn 0.432600 0.587800 0.683600 +vn 0.400200 -0.660500 0.635200 +vn 0.635200 -0.660500 0.400200 +vn -0.683600 0.587800 -0.432600 +vn -0.432600 0.587800 -0.683600 +vn -0.400200 -0.660500 -0.635200 +vn -0.635200 -0.660500 -0.400200 +vn 0.139800 0.590500 -0.794800 +vn 0.017200 0.991500 -0.128400 +vn 0.062900 0.992600 -0.104200 +vn -0.683600 0.587800 0.432600 +vn -0.794800 0.590500 0.139800 +vn -0.730800 -0.671000 0.125100 +vn -0.635200 -0.660500 0.400200 +vn -0.139800 0.590500 -0.794800 +vn -0.125100 -0.671000 -0.730800 +vn 0.794800 0.590500 -0.139800 +vn 0.730800 -0.671000 -0.125100 +vn 0.139800 0.590500 0.794800 +vn 0.125100 -0.671000 0.730800 +vn -0.794800 0.590500 -0.139800 +vn -0.730800 -0.671000 -0.125100 +vn -0.432600 0.587800 0.683600 +vn -0.062900 0.992600 0.104200 +vn -0.104200 0.992600 0.062900 +vn 0.125100 -0.671000 -0.730800 +vn 0.794800 0.590500 0.139800 +vn 0.730800 -0.671000 0.125100 +vn -0.139800 0.590500 0.794800 +vn -0.125100 -0.671000 0.730800 +vn -0.400200 -0.660500 0.635200 +vn -0.128400 0.991500 -0.017200 +vn -0.104200 0.992600 -0.062900 +vn 0.017200 0.991500 0.128400 +vn -0.017200 0.991500 0.128400 +vn 0.128400 0.991500 -0.017200 +vn 0.128400 0.991500 0.017200 +vn -0.017200 0.991500 -0.128400 +vn -0.128400 0.991500 0.017200 +vn 0.062900 0.992600 0.104200 +vn 0.104200 0.992600 -0.062900 +vn -0.062900 0.992600 -0.104200 +vn 0.104200 0.992600 0.062900 +vn 0.000000 1.000000 0.000000 +vn 0.000000 -1.000000 0.000000 +g Cylinder_Cylinder_top-sides +s 1 +f 21/1/1 47/2/2 24/3/3 46/4/4 +f 23/5/5 49/6/6 26/7/7 48/8/8 +f 19/9/9 45/10/10 22/11/11 44/12/12 +f 21/13/1 5/6/13 40/14/14 32/15/15 +f 43/16/16 11/17/17 4/18/18 20/19/19 +f 45/10/10 13/20/20 6/21/21 22/11/11 +f 47/2/2 15/22/22 8/23/23 24/3/3 +f 49/6/6 17/24/24 10/25/25 26/7/7 +f 3/26/26 12/27/27 4/28/18 11/29/17 +f 43/30/16 25/31/28 30/32/29 29/33/30 +f 5/34/13 14/35/31 6/21/21 13/20/20 +f 7/36/32 16/37/33 8/23/23 15/22/22 +f 17/24/24 9/38/34 18/39/35 10/25/25 +f 9/38/34 25/40/28 50/41/36 18/39/35 +f 7/36/32 23/42/5 48/43/8 16/37/33 +f 5/34/13 21/44/1 46/45/4 14/35/31 +f 3/26/26 19/46/9 44/47/12 12/27/27 +f 25/48/28 43/16/16 20/19/19 50/49/36 +f 19/50/9 3/16/26 41/51/37 33/52/38 +f 9/10/34 17/53/24 34/54/39 38/55/40 +f 7/2/32 15/56/22 35/57/41 39/58/42 +f 5/6/13 13/59/20 36/60/43 40/14/14 +f 3/16/26 11/61/17 37/62/44 41/51/37 +f 17/53/24 49/63/6 2/64/45 34/54/39 +f 15/56/22 47/65/2 27/66/46 35/57/41 +f 13/59/20 45/67/10 28/68/47 36/60/43 +f 49/63/6 23/69/5 31/70/48 2/64/45 +f 11/61/17 43/30/16 29/33/30 37/62/44 +f 25/31/28 9/10/34 38/55/40 30/32/29 +f 47/65/2 21/13/1 32/15/15 27/66/46 +f 23/69/5 7/2/32 39/58/42 31/70/48 +f 45/67/10 19/50/9 33/52/38 28/68/47 +f 30/32/29 38/55/40 1/71/49 +f 38/55/40 34/54/39 1/71/49 +f 34/54/39 2/64/45 1/71/49 +f 2/64/45 31/70/48 1/71/49 +f 31/70/48 39/58/42 1/71/49 +f 39/58/42 35/57/41 1/71/49 +f 35/57/41 27/66/46 1/71/49 +f 27/66/46 32/15/15 1/71/49 +f 32/15/15 40/14/14 1/71/49 +f 40/14/14 36/60/43 1/71/49 +f 36/60/43 28/68/47 1/71/49 +f 28/68/47 33/52/38 1/71/49 +f 33/52/38 41/51/37 1/71/49 +f 41/51/37 37/62/44 1/71/49 +f 37/62/44 29/33/30 1/71/49 +f 29/33/30 30/32/29 1/71/49 +g Cylinder_Cylinder_bottom +f 22/31/11 6/10/21 42/71/50 +f 4/16/18 12/61/27 42/71/50 +f 12/61/27 44/30/12 42/71/50 +f 44/30/12 22/31/11 42/71/50 +f 14/53/31 46/63/4 42/71/50 +f 46/63/4 24/69/3 42/71/50 +f 24/69/3 8/2/23 42/71/50 +f 8/2/23 16/56/33 42/71/50 +f 16/56/33 48/65/8 42/71/50 +f 48/65/8 26/13/7 42/71/50 +f 26/13/7 10/6/25 42/71/50 +f 20/50/19 4/16/18 42/71/50 +f 6/10/21 14/53/31 42/71/50 +f 10/6/25 18/59/35 42/71/50 +f 18/59/35 50/67/36 42/71/50 +f 50/67/36 20/50/19 42/71/50 diff --git a/homedecor/textures/homedecor_rug_small.png b/homedecor/textures/homedecor_rug_small.png index 5a648d10bb030c1505832f9a802edf750b672843..b2a441d69f5c1e66adc5e857908c80aafc763333 100644 GIT binary patch literal 1079 zcmWlZ`FqoJ0LH)LPy`XY5xh@4@V*ssxB*i(5m3Q{LxjPkbgM~|v^Hs4d!(&x(j=zM zVUustnDnyS*pvZ7@xc2+MY#k)LFIY;2Yh@S@AJIx=g0T`>1CF5Eu1=e=41fC)Q&}M zOUF3>7-wYCkK6^CZ9xDXNQ zHE)s#ViBXVV?e0ejvGv6p~Ic@SAU9@DF&H0nIWI@(8IAtiV7Ws0jVk=d3Oo0&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