mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 21:21:34 +00:00
fail in a non crashy way for big chunk model generation
This commit is contained in:
@ -7,7 +7,8 @@ struct ChunkMeshBuilder {
|
|||||||
for side in [ Side.left, .right, .down, .up, .back, .front ] {
|
for side in [ Side.left, .right, .down, .up, .back, .front ] {
|
||||||
let globalPos = chunk.origin &+ position
|
let globalPos = chunk.origin &+ position
|
||||||
if case .air = world.getBlock(at: globalPos.offset(by: side)).type {
|
if case .air = world.getBlock(at: globalPos.offset(by: side)).type {
|
||||||
let orig = UInt16(vertices.count)
|
//FIXME: use 32 bit indices for really big chunks
|
||||||
|
let orig = UInt16(truncatingIfNeeded: vertices.count)
|
||||||
vertices.append(contentsOf: cubeVertices[side]!.map {
|
vertices.append(contentsOf: cubeVertices[side]!.map {
|
||||||
.init(
|
.init(
|
||||||
position: SIMD3(position) + $0.position,
|
position: SIMD3(position) + $0.position,
|
||||||
|
Reference in New Issue
Block a user