forked from Mirrorlandia_minetest/minetest
Fix wallmounted mesh rotations
This commit is contained in:
parent
a6ba042cf7
commit
da0f1e5497
@ -1731,9 +1731,9 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
|
|||||||
} else if (f.param_type_2 == CPT2_WALLMOUNTED) {
|
} else if (f.param_type_2 == CPT2_WALLMOUNTED) {
|
||||||
//convert wallmounted to 6dfacedir.
|
//convert wallmounted to 6dfacedir.
|
||||||
//when cache enabled, it is already converted
|
//when cache enabled, it is already converted
|
||||||
facedir = n.getWallMounted(nodedef);
|
facedir = n.getWallMounted(nodedef);
|
||||||
if (!enable_mesh_cache) {
|
if (!enable_mesh_cache) {
|
||||||
static const u8 wm_to_6d[6] = {20, 0, 16, 12, 8, 4};
|
static const u8 wm_to_6d[6] = {20, 0, 16+1, 12+3, 8, 4+2};
|
||||||
facedir = wm_to_6d[facedir];
|
facedir = wm_to_6d[facedir];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -879,7 +879,7 @@ void CNodeDefManager::updateTextures(IGameDef *gamedef)
|
|||||||
meshmanip->recalculateNormals(f->mesh_ptr[j], true, false);
|
meshmanip->recalculateNormals(f->mesh_ptr[j], true, false);
|
||||||
}
|
}
|
||||||
} else if (enable_mesh_cache && f->mesh_ptr[0] && (f->param_type_2 == CPT2_WALLMOUNTED)) {
|
} else if (enable_mesh_cache && f->mesh_ptr[0] && (f->param_type_2 == CPT2_WALLMOUNTED)) {
|
||||||
static const u8 wm_to_6d[6] = {20, 0, 16, 12, 8, 4};
|
static const u8 wm_to_6d[6] = {20, 0, 16+1, 12+3, 8, 4+2};
|
||||||
for (u16 j = 1; j < 6; j++) {
|
for (u16 j = 1; j < 6; j++) {
|
||||||
f->mesh_ptr[j] = cloneMesh(f->mesh_ptr[0]);
|
f->mesh_ptr[j] = cloneMesh(f->mesh_ptr[0]);
|
||||||
rotateMeshBy6dFacedir(f->mesh_ptr[j], wm_to_6d[j]);
|
rotateMeshBy6dFacedir(f->mesh_ptr[j], wm_to_6d[j]);
|
||||||
|
Loading…
Reference in New Issue
Block a user