use mesh nodes for chainlink and barbed wire fences and corners

(so that I can give them custom collision boxes)
This commit is contained in:
Vanessa Ezekowitz 2015-10-04 09:31:50 -04:00
parent e3f3df7508
commit 7ac5e9e815
6 changed files with 416 additions and 56 deletions

View File

@ -184,43 +184,27 @@ homedecor.register("fence_privacy_corner", {
homedecor.register("fence_barbed_wire", {
description = S("Barbed Wire Fence"),
mesh = "homedecor_fence_barbed_wire.obj",
tiles = {"homedecor_fence_barbed_wire.png"},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = homedecor.nodebox.slab_z(-0.125),
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, -- left post
{ 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
{ -6/16, -8/16, 7/16, 6/16, 8/16, 7/16 } -- the wire
}
},
collision_box = homedecor.nodebox.slab_z(-0.125),
})
homedecor.register("fence_barbed_wire_corner", {
description = S("Barbed Wire Fence Corner"),
tiles = {
"homedecor_fence_barbed_wire.png"
},
mesh = "homedecor_fence_barbed_wire_corner.obj",
tiles = { "homedecor_fence_barbed_wire.png" },
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = homedecor.nodebox.corner_xz(0.125, -0.125),
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, -- left post
{ 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
{ -6/16, -8/16, 7/16, 6/16, 8/16, 7/16 }, -- the wire
{ -8/16, -8/16, -8/16, -6/16, 8/16, -6/16 }, -- front post
{ -7/16, -8/16, -6/16, -7/16, 8/16, 6/16 } -- more wire
}
},
collision_box = homedecor.nodebox.corner_xz(0.125, -0.125),
})
homedecor.register("fence_chainlink", {
description = S("Chainlink Fence"),
mesh="homedecor_fence_chainlink.obj",
tiles = {
"homedecor_fence_chainlink_tb.png",
"homedecor_fence_chainlink_tb.png",
@ -232,20 +216,13 @@ homedecor.register("fence_chainlink", {
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = homedecor.nodebox.slab_z(-0.125),
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, 6/16, -7/16, 8/16, 8/16 }, -- left post
{ 7/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
{ -8/16, 7/16, 13/32, 8/16, 8/16, 15/32 }, -- top piece
{ -8/16, -8/16, 13/32, 8/16, -7/16, 15/32 }, -- bottom piece
{ -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } -- the chainlink itself
}
},
collision_box = homedecor.nodebox.slab_z(-0.125),
})
homedecor.register("fence_chainlink_corner", {
description = S("Chainlink Fence Corner"),
mesh = "homedecor_fence_chainlink_corner.obj",
tiles = {
"homedecor_fence_chainlink_corner_top.png",
"homedecor_fence_chainlink_corner_top.png",
@ -257,20 +234,7 @@ homedecor.register("fence_chainlink_corner", {
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = homedecor.nodebox.corner_xz(0.125, -0.125),
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, -- left post, rear
{ -8/16, -8/16, -8/16, -6/16, 8/16, -7/16 }, -- left post, front
{ 7/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post, rear
{ -8/16, 7/16, 13/32, 8/16, 8/16, 15/32 }, -- top piece, rear
{ -8/16, -8/16, 13/32, 8/16, -7/16, 15/32 }, -- bottom piece, rear
{ -15/32, 7/16, -8/16, -13/32, 8/16, 8/16 }, -- top piece, side
{ -15/32, -8/16, -8/16, -13/32, -7/16, 8/16 }, -- bottom piece, side
{ -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }, -- the chainlink itself, rear
{ -7/16, -8/16, -8/16, -7/16, 8/16, 8/16 } -- the chainlink itself, side
}
},
collision_box = homedecor.nodebox.corner_xz(0.125, -0.125),
})
homedecor.register("fence_wrought_iron_2", {

View File

@ -1,10 +0,0 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl None
Ns 0
Ka 0.000000 0.000000 0.000000
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2

View File

@ -0,0 +1,60 @@
# Blender v2.73 (sub 0) OBJ File: 'homedecor-fence-barbed.blend'
# www.blender.org
o Cylinder
v -0.500000 -0.500000 0.500000
v -0.500000 -0.500000 0.375000
v 0.500000 -0.500000 0.375000
v 0.500000 -0.500000 0.500000
v -0.500000 0.500000 0.500000
v -0.500000 0.500000 0.375000
v 0.500000 0.500000 0.375000
v 0.500000 0.500000 0.500000
v 0.375000 -0.500000 0.375000
v 0.375000 -0.500000 0.500000
v 0.375000 0.500000 0.375000
v 0.375000 0.500000 0.500000
v -0.375000 -0.500000 0.500000
v -0.375000 -0.500000 0.375000
v -0.375000 0.500000 0.500000
v -0.375000 0.500000 0.375000
v 0.375000 -0.500000 0.437500
v 0.375000 0.500000 0.437500
v -0.375000 -0.500000 0.437500
v -0.375000 0.500000 0.437500
vt 1.000000 1.000000
vt 0.875000 1.000000
vt 0.875000 -0.000000
vt 1.000000 -0.000000
vt 1.000000 0.875000
vt 0.875000 0.875000
vt 0.125000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 0.125000 0.000000
vt 1.000000 0.125000
vt 0.875000 0.125000
vt 0.000000 0.125000
vt 0.125000 0.125000
vt 0.000000 0.875000
vt 0.125000 0.875000
vn -1.000000 0.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 0.000000 -1.000000
g Cylinder_Cylinder_None
s off
f 5/1/1 6/2/1 2/3/1 1/4/1
f 8/5/2 7/1/2 11/2/2 12/6/2
f 7/7/3 8/8/3 4/9/3 3/10/3
f 4/9/4 8/8/4 12/7/4 10/10/4
f 3/4/5 4/11/5 10/12/5 9/3/5
f 11/2/1 9/3/1 10/4/1 12/1/1
f 7/1/6 3/4/6 9/3/6 11/2/6
f 15/8/3 13/9/3 14/10/3 16/7/3
f 1/13/5 2/9/5 14/10/5 13/14/5
f 2/9/6 6/8/6 16/7/6 14/10/6
f 6/8/2 5/15/2 15/16/2 16/7/2
f 5/1/4 1/4/4 13/3/4 15/2/4
f 17/10/6 19/3/6 20/2/6 18/7/6

View File

@ -0,0 +1,79 @@
# Blender v2.73 (sub 0) OBJ File: 'homedecor-fence-barbed-corner.blend'
# www.blender.org
o Cylinder
v -0.500000 -0.500000 0.500000
v -0.500000 -0.500000 0.375000
v 0.500000 -0.500000 0.375000
v 0.500000 -0.500000 0.500000
v -0.500000 0.500000 0.500000
v -0.500000 0.500000 0.375000
v 0.500000 0.500000 0.375000
v 0.500000 0.500000 0.500000
v 0.375000 -0.500000 0.375000
v 0.375000 -0.500000 0.500000
v 0.375000 0.500000 0.375000
v 0.375000 0.500000 0.500000
v -0.375000 -0.500000 0.500000
v -0.375000 -0.500000 0.375000
v -0.375000 0.500000 0.500000
v -0.375000 0.500000 0.375000
v 0.375000 -0.500000 0.437500
v 0.375000 0.500000 0.437500
v -0.375000 -0.500000 0.437500
v -0.375000 0.500000 0.437500
v 0.375000 -0.500000 -0.500000
v 0.500000 -0.500000 -0.500000
v 0.375000 0.500000 -0.500000
v 0.500000 0.500000 -0.500000
v 0.375000 -0.500000 -0.375000
v 0.500000 -0.500000 -0.375000
v 0.375000 0.500000 -0.375000
v 0.500000 0.500000 -0.375000
v 0.437500 -0.500000 -0.375000
v 0.437500 0.500000 -0.375000
v 0.437500 -0.500000 0.375000
v 0.437500 0.500000 0.375000
vt 1.000000 1.000000
vt 0.875000 1.000000
vt 0.875000 -0.000000
vt 1.000000 -0.000000
vt 1.000000 0.875000
vt 0.875000 0.875000
vt 0.125000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 0.125000 0.000000
vt 1.000000 0.125000
vt 0.875000 0.125000
vt 0.000000 0.125000
vt 0.125000 0.125000
vt 0.000000 0.875000
vt 0.125000 0.875000
vn -1.000000 0.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 0.000000 -1.000000
g Cylinder_Cylinder_None
s off
f 5/1/1 6/2/1 2/3/1 1/4/1
f 8/5/2 7/1/2 11/2/2 12/6/2
f 7/7/3 8/8/3 4/9/3 3/10/3
f 4/9/4 8/8/4 12/7/4 10/10/4
f 3/4/5 4/11/5 10/12/5 9/3/5
f 11/2/1 9/3/1 10/4/1 12/1/1
f 7/1/6 3/4/6 9/3/6 11/2/6
f 15/8/3 13/9/3 14/10/3 16/7/3
f 1/13/5 2/9/5 14/10/5 13/14/5
f 2/9/6 6/8/6 16/7/6 14/10/6
f 6/8/2 5/15/2 15/16/2 16/7/2
f 5/1/4 1/4/4 13/3/4 15/2/4
f 17/10/6 19/3/6 20/2/6 18/7/6
f 24/5/2 23/1/2 27/2/2 28/6/2
f 23/7/6 24/8/6 22/9/6 21/10/6
f 22/9/3 24/8/3 28/7/3 26/10/3
f 21/4/5 22/11/5 26/12/5 25/3/5
f 27/2/4 25/3/4 26/4/4 28/1/4
f 23/1/1 21/4/1 25/3/1 27/2/1
f 29/10/1 31/3/1 32/2/1 30/7/1

View File

@ -0,0 +1,105 @@
# Blender v2.73 (sub 0) OBJ File: 'homedecor-fence-chainlink.blend'
# www.blender.org
o Cylinder
v 0.500000 -0.500000 0.500000
v -0.500000 -0.500000 0.500000
v -0.500000 -0.500000 0.375000
v 0.500000 -0.500000 0.375000
v 0.500000 0.500000 0.500000
v -0.500000 0.500000 0.500000
v -0.500000 0.500000 0.375000
v 0.500000 0.500000 0.375000
v 0.437500 -0.500000 0.500000
v 0.437500 -0.500000 0.375000
v 0.437500 0.500000 0.500000
v 0.437500 0.500000 0.375000
v -0.437500 -0.500000 0.500000
v -0.437500 -0.500000 0.375000
v -0.437500 0.500000 0.500000
v -0.437500 0.500000 0.375000
v -0.437500 0.500000 0.406250
v -0.437500 -0.500000 0.406250
v 0.437500 0.500000 0.406250
v 0.437500 -0.500000 0.406250
v -0.437500 0.500000 0.468750
v -0.437500 -0.500000 0.468750
v 0.437500 0.500000 0.468750
v 0.437500 -0.500000 0.468750
v -0.437500 0.437500 0.406250
v 0.437500 0.437500 0.406250
v -0.437500 0.437500 0.468750
v 0.437500 0.437500 0.468750
v -0.437500 -0.437500 0.406250
v 0.437500 -0.437500 0.406250
v -0.437500 -0.437500 0.468750
v 0.437500 -0.437500 0.468750
v -0.437500 0.437500 0.437500
v 0.437500 0.437500 0.437500
v -0.437500 -0.437500 0.437500
v 0.437500 -0.437500 0.437500
vt 0.000000 1.000000
vt 0.000000 0.875000
vt 0.062500 0.875000
vt 0.062500 1.000000
vt 1.000000 0.875000
vt 1.000000 1.000000
vt 0.937500 1.000000
vt 0.937500 0.875000
vt 0.062500 0.968750
vt 0.062500 0.906250
vt 0.937500 0.906250
vt 0.937500 0.968750
vt 1.000000 0.125000
vt 0.937500 0.125000
vt 0.937500 0.000000
vt 1.000000 0.000000
vt 0.000000 0.000000
vt 0.062500 0.000000
vt 0.062500 0.125000
vt 0.000000 0.125000
vt 0.062500 0.093750
vt 0.062500 0.031250
vt 0.937500 0.031250
vt 0.937500 0.093750
vt 0.875000 1.000000
vt 0.875000 0.000000
vt 0.125000 1.000000
vt 0.125000 0.000000
vt 0.062500 0.937500
vt 0.937500 0.937500
vt 0.062500 0.062500
vt 0.937500 0.062500
vn 0.000000 1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn -1.000000 0.000000 -0.000000
vn 1.000000 0.000000 0.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 0.000000 -1.000000
g Cylinder_Cylinder_top
s off
f 5/1/1 8/2/1 12/3/1 11/4/1
f 7/5/1 6/6/1 15/7/1 16/8/1
f 23/9/1 19/10/1 17/11/1 21/12/1
f 30/10/1 29/11/1 31/12/1 32/9/1
g Cylinder_Cylinder_bottom
f 3/13/2 14/14/2 13/15/2 2/16/2
f 1/17/2 9/18/2 10/19/2 4/20/2
f 26/21/2 28/22/2 27/23/2 25/24/2
f 24/22/2 22/23/2 18/24/2 20/21/2
g Cylinder_Cylinder_right
f 6/6/3 7/25/3 3/26/3 2/16/3
f 12/25/3 10/26/3 9/16/3 11/6/3
g Cylinder_Cylinder_left
f 8/27/4 5/1/4 1/17/4 4/28/4
f 13/17/4 14/28/4 16/27/4 15/1/4
g Cylinder_Cylinder_back
f 1/17/5 5/1/5 11/4/5 9/18/5
f 6/6/5 2/16/5 13/15/5 15/7/5
f 28/29/5 23/4/5 21/7/5 27/30/5
f 32/31/5 31/32/5 22/15/5 24/18/5
g Cylinder_Cylinder_front
f 8/1/6 4/17/6 10/18/6 12/4/6
f 3/16/6 7/6/6 16/7/6 14/15/6
f 25/30/6 17/7/6 19/4/6 26/29/6
f 18/15/6 29/32/6 30/31/6 20/18/6
f 33/30/5 35/32/5 36/31/5 34/29/5

View File

@ -0,0 +1,162 @@
# Blender v2.73 (sub 0) OBJ File: 'homedecor-fence-chainlink-corner.blend'
# www.blender.org
o Cylinder
v -0.500000 -0.500000 0.500000
v -0.500000 -0.500000 0.375000
v 0.500000 -0.500000 0.375000
v -0.500000 0.500000 0.500000
v -0.500000 0.500000 0.375000
v 0.500000 0.500000 0.375000
v -0.437500 -0.500000 0.500000
v -0.437500 -0.500000 0.375000
v -0.437500 0.500000 0.500000
v -0.437500 0.500000 0.375000
v -0.437500 0.500000 0.406250
v -0.437500 -0.500000 0.406250
v 0.375000 0.500000 0.406250
v 0.375000 -0.500000 0.406250
v -0.437500 0.500000 0.468750
v -0.437500 -0.500000 0.468750
v 0.375000 0.500000 0.468750
v 0.375000 -0.500000 0.468750
v -0.437500 0.437500 0.406250
v 0.375000 0.437500 0.406250
v -0.437500 0.437500 0.468750
v 0.375000 0.437500 0.468750
v -0.437500 -0.437500 0.406250
v 0.375000 -0.437500 0.406250
v -0.437500 -0.437500 0.468750
v 0.375000 -0.437500 0.468750
v -0.437500 0.437500 0.437500
v -0.437500 -0.437500 0.437500
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v 0.375000 -0.500000 0.500000
v 0.375000 -0.500000 -0.500000
v 0.500000 0.500000 -0.500000
v 0.500000 0.500000 0.500000
v 0.375000 0.500000 0.500000
v 0.375000 0.500000 -0.500000
v 0.500000 -0.500000 -0.437500
v 0.375000 -0.500000 -0.437500
v 0.500000 0.500000 -0.437500
v 0.375000 0.500000 -0.437500
v 0.406250 0.500000 0.375000
v 0.406250 -0.500000 0.375000
v 0.406250 0.500000 -0.437500
v 0.406250 -0.500000 -0.437500
v 0.468750 0.500000 0.375000
v 0.468750 -0.500000 0.375000
v 0.468750 0.500000 -0.437500
v 0.468750 -0.500000 -0.437500
v 0.406250 0.437500 0.375000
v 0.406250 0.437500 -0.437500
v 0.468750 0.437500 0.375000
v 0.468750 0.437500 -0.437500
v 0.406250 -0.437500 0.375000
v 0.406250 -0.437500 -0.437500
v 0.468750 -0.437500 0.375000
v 0.468750 -0.437500 -0.437500
v 0.375000 0.437500 0.437500
v 0.437500 0.437500 -0.437500
v 0.375000 -0.437500 0.437500
v 0.437500 -0.437500 -0.437500
v 0.375000 -0.500000 0.375000
v 0.375000 0.500000 0.375000
v 0.437500 0.437500 0.375000
v 0.437500 -0.437500 0.375000
vt 0.875000 0.937500
vt 1.000000 0.937500
vt 1.000000 1.000000
vt 0.875000 1.000000
vt 0.062500 0.000000
vt 0.062500 0.125000
vt 0.000000 0.125000
vt 0.000000 0.000000
vt 0.875000 0.125000
vt 0.875000 0.000000
vt 1.000000 0.000000
vt 1.000000 0.125000
vt 0.906250 0.125000
vt 0.968750 0.125000
vt 0.968750 0.937500
vt 0.906250 0.937500
vt 0.875000 0.093750
vt 0.062500 0.093750
vt 0.062500 0.031250
vt 0.875000 0.031250
vt 1.000000 0.062500
vt 0.875000 0.062500
vt 0.062500 0.875000
vt 0.062500 1.000000
vt 0.000000 1.000000
vt 0.000000 0.875000
vt 0.875000 0.875000
vt 1.000000 0.875000
vt 0.968750 0.062500
vt 0.968750 0.875000
vt 0.906250 0.875000
vt 0.906250 0.062500
vt 0.875000 0.906250
vt 0.875000 0.968750
vt 0.062500 0.968750
vt 0.062500 0.906250
vt 0.062500 0.937500
vt 0.062500 0.062500
vt 0.937500 1.000000
vt 0.125000 1.000000
vt 0.125000 0.937500
vt 0.937500 0.937500
vt 0.937500 0.062500
vt 0.125000 0.062500
vt 0.125000 0.000000
vt 0.937500 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn -1.000000 0.000000 -0.000000
vn 1.000000 0.000000 0.000000
vn -0.000000 0.000000 1.000000
vn 0.000000 0.000000 -1.000000
g Cylinder_Cylinder_top
s off
f 40/1/1 39/2/1 33/3/1 36/4/1
f 9/5/1 10/6/1 5/7/1 4/8/1
f 62/9/1 35/10/1 34/11/1 6/12/1
f 41/13/1 45/14/1 47/15/1 43/16/1
f 54/16/1 53/13/1 55/14/1 56/15/1
f 13/17/1 11/18/1 15/19/1 17/20/1
f 26/20/1 24/17/1 23/18/1 25/19/1
g Cylinder_Cylinder_bottom
f 32/10/2 29/11/2 37/21/2 38/22/2
f 8/23/2 7/24/2 1/25/2 2/26/2
f 61/27/2 3/28/2 30/3/2 31/4/2
f 52/29/2 51/30/2 49/31/2 50/32/2
f 46/30/2 42/31/2 44/32/2 48/29/2
f 20/33/2 22/34/2 21/35/2 19/36/2
f 14/33/2 18/34/2 16/35/2 12/36/2
g Cylinder_Cylinder_right
f 5/4/3 2/10/3 1/11/3 4/3/3
f 50/37/3 49/1/3 41/4/3 43/24/3
f 44/5/3 42/10/3 53/22/3 54/38/3
f 32/8/3 38/5/3 40/24/3 36/25/3
f 61/10/3 31/11/3 35/3/3 62/4/3
g Cylinder_Cylinder_left
f 47/39/4 45/40/4 51/41/4 52/42/4
f 56/43/4 55/44/4 46/45/4 48/46/4
f 37/46/4 29/11/4 33/3/4 39/39/4
f 30/8/4 3/45/4 6/40/4 34/25/4
f 8/45/4 10/40/4 9/25/4 7/8/4
f 64/44/4 60/43/4 58/42/4 63/41/4
g Cylinder_Cylinder_back
f 31/10/5 30/11/5 34/3/5 35/4/5
f 38/10/5 37/11/5 39/3/5 40/4/5
f 7/5/5 9/24/5 4/25/5 1/8/5
f 17/4/5 15/24/5 21/37/5 22/1/5
f 26/22/5 25/38/5 16/5/5 18/10/5
g Cylinder_Cylinder_front
f 36/40/6 33/25/6 29/8/6 32/45/6
f 3/8/6 61/45/6 62/40/6 6/25/6
f 2/11/6 5/3/6 10/39/6 8/46/6
f 20/41/6 19/42/6 11/39/6 13/40/6
f 24/44/6 14/45/6 12/46/6 23/43/6
f 59/44/6 28/43/6 27/42/6 57/41/6