mirror of
https://github.com/tetreum/brickcraft.git
synced 2026-05-01 14:29:09 -05:00
+ ChunkRenderer - Paint block sides properly
This commit is contained in:
@@ -539,12 +539,24 @@ namespace Brickcraft.World
|
||||
vertices.Add(pos);
|
||||
colors.Add(color);
|
||||
|
||||
// temporal | testing | dunno what im doing here
|
||||
if (face == "top" || face == "bottom") {
|
||||
uvs.Add(new Vector2(xt.x, zt.x));
|
||||
} else {
|
||||
uvs.Add(new Vector2(xt.y, zt.y));
|
||||
}
|
||||
}
|
||||
if (face != "top" && face != "bottom") {
|
||||
Rect coords = BlockUVs.GetUVFromTypeAndFace((BlockType)block, BlockFace.Side);
|
||||
|
||||
float yMax = coords.y + coords.height;
|
||||
float xMax = coords.x + coords.width;
|
||||
float xMin = coords.x;
|
||||
float yMin = coords.y;
|
||||
|
||||
uvs.Add(new Vector2(xMin, yMin));
|
||||
uvs.Add(new Vector2(xMin, yMax));
|
||||
uvs.Add(new Vector2(xMax, yMax));
|
||||
uvs.Add(new Vector2(xMax, yMin));
|
||||
}
|
||||
foreach (int index in faceMap.triangles) {
|
||||
triangles.Add(index + vertexIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user