transform metanodeboxes with facedir nodes

This commit is contained in:
darkrose 2017-06-26 00:06:43 +10:00
parent 202a6ff9af
commit 794f157d7d
5 changed files with 14 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 377 B

After

Width:  |  Height:  |  Size: 393 B

View File

@ -2995,10 +2995,14 @@ void meshgen_nodebox(MeshMakeData *data, v3s16 p, MapNode &n, SelectedNode &sele
boxes = meta->getNodeBoxes(n);
if (boxes.size() > 0) {
boxes = transformNodeBox(n, boxes);
for (int i = 0; i < 6; i++) {
// Handles facedir rotation for textures
tiles[i] = getMetaTile(n,p,tile_dirs[i],selected);
}
meshgen_build_nodebox(data,p,n,selected,boxes,tiles);
}

View File

@ -1090,10 +1090,10 @@ void content_mapnode_special(bool repeat)
f->setTexture(5, "wood.png^chests_front.png"); // Z-
f->setMetaTexture(0,"chests_meta_top.png");
f->setMetaTexture(1,"chests_meta_bottom.png");
f->setMetaTexture(2,"chests_meta_side.png^[transformFX");
f->setMetaTexture(3,"chests_meta_side.png");
f->setMetaTexture(4,"chests_meta_lock.png");
f->setMetaTexture(5,"chests_meta_exo.png");
f->setMetaTexture(2,"chests_meta_side.png");
f->setMetaTexture(3,"chests_meta_side.png^[transformFX");
f->setMetaTexture(4,"chests_meta_exo.png");
f->setMetaTexture(5,"chests_meta_lock.png");
f->param_type = CPT_LIGHT;
f->param2_type = CPT_FACEDIR_SIMPLE;
f->light_propagates = true;

View File

@ -302,23 +302,23 @@ std::vector<NodeBox> ChestNodeMetadata::getNodeBoxes(MapNode &n)
if (m_is_locked) {
boxes.push_back(NodeBox(
v3s16(0,180,0),aabb3f(-0.125*BS,-0.3125*BS,-0.5*BS,0.125*BS,-0.125*BS,-0.4375*BS)
aabb3f(-0.125*BS,-0.3125*BS,-0.5*BS,0.125*BS,-0.125*BS,-0.4375*BS)
));
boxes.push_back(NodeBox(
v3s16(0,180,0),aabb3f(0.0625*BS,-0.125*BS,-0.5*BS,0.09375*BS,0.0,-0.4375*BS)
aabb3f(0.0625*BS,-0.125*BS,-0.5*BS,0.09375*BS,0.0,-0.4375*BS)
));
boxes.push_back(NodeBox(
v3s16(0,180,0),aabb3f(-0.09375*BS,-0.125*BS,-0.5*BS,-0.0625*BS,0.0,-0.4375*BS)
aabb3f(-0.09375*BS,-0.125*BS,-0.5*BS,-0.0625*BS,0.0,-0.4375*BS)
));
}else if (m_is_exo) {
boxes.push_back(NodeBox(
aabb3f(-0.125*BS,-0.3125*BS,0.4375*BS,0.125*BS,-0.1875*BS,0.5*BS)
v3s16(0,180,0),aabb3f(-0.125*BS,-0.3125*BS,0.4375*BS,0.125*BS,-0.1875*BS,0.5*BS)
));
boxes.push_back(NodeBox(
aabb3f(-0.0625*BS,-0.375*BS,0.4375*BS,0.0625*BS,-0.3125*BS,0.5*BS)
v3s16(0,180,0),aabb3f(-0.0625*BS,-0.375*BS,0.4375*BS,0.0625*BS,-0.3125*BS,0.5*BS)
));
boxes.push_back(NodeBox(
aabb3f(-0.0625*BS,-0.1875*BS,0.4375*BS,0.0625*BS,-0.125*BS,0.5*BS)
v3s16(0,180,0),aabb3f(-0.0625*BS,-0.1875*BS,0.4375*BS,0.0625*BS,-0.125*BS,0.5*BS)
));
}