Skip to content

Commit 129de77

Browse files
committed
fix render order
1 parent c054984 commit 129de77

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/scripts/world/World.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { ChunkManager } from './ChunkManager.js'
99
const World = class World {
1010
constructor (game) {
1111
this.game = game
12-
this.cellMesh = {}
1312
this.blocksDef = this.game.al.get('blocksDef')
1413
this.models = {}
1514
this.chunkTerrain = new ChunkTerrain({
@@ -46,9 +45,9 @@ const World = class World {
4645
}
4746

4847
updateRenderOrder (cell) {
49-
for (const i in this.cellMesh) {
50-
const x = vec3(this.chunkTerrain.strToVec(i))
51-
this.cellMesh[i].renderOrder = -vec3(...cell).distanceTo(x)
48+
for (const [k,v] of this.chunkManager.cellMesh) {
49+
const x = vec3(this.chunkTerrain.strToVec(k))
50+
v.renderOrder=-vec3(...cell).distanceTo(x)
5251
}
5352
}
5453

0 commit comments

Comments
 (0)