Create mid panel

master
Jordan Irwin 2021-08-24 12:59:04 -07:00
parent 727d1af152
commit 24e1510889
5 changed files with 83 additions and 1 deletions

View File

@ -1,4 +1,3 @@
TODO:
- add methods for opening doors in opposite directions
- add mid panel

View File

@ -32,6 +32,18 @@ simple_models = {
box = {-0.5, -0.5, -0.5, 0.5, 1.5, -0.45},
},
--- Mid panel
--
-- Alias: simple_models.panel_mid
--
-- @table simple_models.panel_mid_1x2x1
-- @tfield string mesh simple_models_panel_mid_1x2x1.obj
-- @tfield table box {-0.5, -0.5, 0.025, 0.5, 1.5, -0.025},
panel_mid_1x2x1 = {
mesh = "simple_models_panel_mid_1x2x1.obj",
box = {-0.5, -0.5, 0.025, 0.5, 1.5, -0.025},
},
--- Rear panel
--
-- Alias: simple_models.panel_rear
@ -47,6 +59,7 @@ simple_models = {
simple_models.cube = simple_models.cube_1x2x1
simple_models.panel = simple_models.panel_1x2x1
simple_models.panel_mid = simple_models.panel_mid_1x2x1
simple_models.panel_rear = simple_models.panel_rear_1x2x1
--- Global table.

Binary file not shown.

View File

@ -0,0 +1,40 @@
# Blender v2.93.2 OBJ File: 'simple_models_panel_mid_1x2x1.blend'
# www.blender.org
mtllib simple_models_panel_mid_1x2x1.mtl
o Cube
v 0.500000 -0.500000 -0.031250
v 0.500000 1.500000 -0.031250
v -0.500000 -0.500000 -0.031250
v -0.500000 1.500000 -0.031250
v 0.500000 -0.500000 0.031250
v 0.500000 1.500000 0.031250
v -0.500000 -0.500000 0.031250
v -0.500000 1.500000 0.031250
vt 0.500000 0.029412
vt 0.500000 0.000000
vt 0.970588 0.000000
vt 0.970588 0.029412
vt 0.970588 0.970588
vt 1.000000 0.029412
vt 1.000000 0.970588
vt 0.000000 0.970588
vt 0.000000 0.029412
vt 0.470588 0.029412
vt 0.470588 0.970588
vt 0.500000 1.000000
vt 0.500000 0.970588
vt 0.970588 1.000000
vn -0.0000 -1.0000 0.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 -0.0000 1.0000
vn 0.0000 1.0000 0.0000
vn -0.0000 0.0000 -1.0000
vn 1.0000 -0.0000 0.0000
usemtl Material
s off
f 1/1/1 5/2/1 7/3/1 3/4/1
f 4/5/2 3/4/2 7/6/2 8/7/2
f 8/8/3 7/9/3 5/10/3 6/11/3
f 6/12/4 2/13/4 4/5/4 8/14/4
f 2/13/5 1/1/5 3/4/5 4/5/5
f 6/11/6 5/10/6 1/1/6 2/13/6

View File

@ -32,6 +32,36 @@ core.register_node("simple_models:panel", {
paramtype2 = "facedir",
groups = {oddly_breakable_by_hand=1},
on_rightclick = function(pos, node, clicker, stack, pointed_thing)
core.swap_node(pos, {
name = "simple_models:panel_mid",
param1 = node.param1,
param2 = node.param2,
})
if core.global_exists("sounds") and sounds.woosh then
sounds.woosh()
end
return stack
end,
})
core.register_node("simple_models:panel_mid", {
description = "Mid Panel",
drawtype = "mesh",
tiles = {"simple_models_sample_panel_1x2x1_map.png"},
mesh = smodel.panel_mid.mesh,
collision_box = {
type = "fixed",
fixed = smodel.panel_mid.box,
},
selection_box = {
type = "fixed",
fixed = smodel.panel_mid.box,
},
paramtype2 = "facedir",
groups = {oddly_breakable_by_hand=1},
on_rightclick = function(pos, node, clicker, stack, pointed_thing)
core.swap_node(pos, {
name = "simple_models:panel_rear",