mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
Offset cuboid origin after scaling the cuboid. (#12558)
This avoids the problem of offset nodes with visual_scale > 1.
This commit is contained in:
parent
d400a98ef0
commit
b270a46e53
@ -377,10 +377,6 @@ void MapblockMeshGenerator::drawAutoLightedCuboid(aabb3f box, const f32 *txc,
|
||||
f32 dx2 = box.MaxEdge.X;
|
||||
f32 dy2 = box.MaxEdge.Y;
|
||||
f32 dz2 = box.MaxEdge.Z;
|
||||
|
||||
box.MinEdge += origin;
|
||||
box.MaxEdge += origin;
|
||||
|
||||
if (scale) {
|
||||
if (!txc) { // generate texture coords before scaling
|
||||
generateCuboidTextureCoords(box, texture_coord_buf);
|
||||
@ -389,11 +385,12 @@ void MapblockMeshGenerator::drawAutoLightedCuboid(aabb3f box, const f32 *txc,
|
||||
box.MinEdge *= f->visual_scale;
|
||||
box.MaxEdge *= f->visual_scale;
|
||||
}
|
||||
box.MinEdge += origin;
|
||||
box.MaxEdge += origin;
|
||||
if (!txc) {
|
||||
generateCuboidTextureCoords(box, texture_coord_buf);
|
||||
txc = texture_coord_buf;
|
||||
}
|
||||
|
||||
if (!tiles) {
|
||||
tiles = &tile;
|
||||
tile_count = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user