turn the ChunkID type alias into a real type

This commit is contained in:
2024-09-08 03:47:26 +10:00
parent 76b61c49ae
commit b804030594
9 changed files with 78 additions and 39 deletions

View File

@ -10,8 +10,8 @@ struct TerrorTowerGenerator: WorldGenerator {
self.noise2 = LayeredNoise(random: &random, octaves: 3, frequency: 0.1)
}
public func makeChunk(id chunkID: SIMD3<Int>) -> Chunk {
let chunkOrigin = chunkID &<< Chunk.shift
public func makeChunk(id chunkID: ChunkID) -> Chunk {
let chunkOrigin = chunkID.getPosition()
var chunk = Chunk(position: chunkOrigin)
chunk.fill(allBy: { position in
let fpos = SIMD3<Float>(chunkOrigin &+ position)