mirror of
https://github.com/minetest/minetest.git
synced 2024-11-04 23:03:46 +01:00
Resized torchlike sprite now attaches to surface (#9303)
This commit is contained in:
parent
468eb4bf57
commit
0877587cce
@ -6569,8 +6569,9 @@ Used by `minetest.register_node`.
|
|||||||
-- Supported for drawtypes "plantlike", "signlike", "torchlike",
|
-- Supported for drawtypes "plantlike", "signlike", "torchlike",
|
||||||
-- "firelike", "mesh".
|
-- "firelike", "mesh".
|
||||||
-- For plantlike and firelike, the image will start at the bottom of the
|
-- For plantlike and firelike, the image will start at the bottom of the
|
||||||
-- node, for the other drawtypes the image will be centered on the node.
|
-- node. For torchlike, the image will start at the surface to which the
|
||||||
-- Note that positioning for "torchlike" may still change.
|
-- node "attaches". For the other drawtypes the image will be centered
|
||||||
|
-- on the node.
|
||||||
|
|
||||||
tiles = {tile definition 1, def2, def3, def4, def5, def6},
|
tiles = {tile definition 1, def2, def3, def4, def5, def6},
|
||||||
-- Textures of node; +Y, -Y, +X, -X, +Z, -Z
|
-- Textures of node; +Y, -Y, +X, -X, +Z, -Z
|
||||||
|
@ -860,17 +860,27 @@ void MapblockMeshGenerator::drawTorchlikeNode()
|
|||||||
for (v3f &vertex : vertices) {
|
for (v3f &vertex : vertices) {
|
||||||
switch (wall) {
|
switch (wall) {
|
||||||
case DWM_YP:
|
case DWM_YP:
|
||||||
vertex.rotateXZBy(-45); break;
|
vertex.Y += -size + BS/2;
|
||||||
|
vertex.rotateXZBy(-45);
|
||||||
|
break;
|
||||||
case DWM_YN:
|
case DWM_YN:
|
||||||
vertex.rotateXZBy( 45); break;
|
vertex.Y += size - BS/2;
|
||||||
|
vertex.rotateXZBy(45);
|
||||||
|
break;
|
||||||
case DWM_XP:
|
case DWM_XP:
|
||||||
vertex.rotateXZBy( 0); break;
|
vertex.X += -size + BS/2;
|
||||||
|
break;
|
||||||
case DWM_XN:
|
case DWM_XN:
|
||||||
vertex.rotateXZBy(180); break;
|
vertex.X += -size + BS/2;
|
||||||
|
vertex.rotateXZBy(180);
|
||||||
|
break;
|
||||||
case DWM_ZP:
|
case DWM_ZP:
|
||||||
vertex.rotateXZBy( 90); break;
|
vertex.X += -size + BS/2;
|
||||||
|
vertex.rotateXZBy(90);
|
||||||
|
break;
|
||||||
case DWM_ZN:
|
case DWM_ZN:
|
||||||
vertex.rotateXZBy(-90); break;
|
vertex.X += -size + BS/2;
|
||||||
|
vertex.rotateXZBy(-90);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drawQuad(vertices);
|
drawQuad(vertices);
|
||||||
|
Loading…
Reference in New Issue
Block a user