Skip to content

Commit ead8b58

Browse files
committed
fix chunk loading perferences
1 parent 98e1792 commit ead8b58

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/scripts/world/ChunkManager.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ class ChunkManager {
66
constructor (game) {
77
this.game = game
88
this.cellMesh = new Map()
9-
setInterval(() => {
10-
TWEEN.update()
11-
})
129
}
1310

1411
addChunk (cellId, vert) {
@@ -30,13 +27,13 @@ class ChunkManager {
3027
}
3128
this.cellMesh.set(cellId, newMesh)
3229
this.game.scene.add(newMesh)
33-
newMesh.position.y = -256
30+
newMesh.position.y = -32
3431

3532
const to = {
3633
y: 0
3734
}
3835
new TWEEN.Tween(newMesh.position)
39-
.to(to, 2000)
36+
.to(to, 1000)
4037
.easing(TWEEN.Easing.Quadratic.Out)
4138
.onComplete(() => {
4239
newMesh.matrixAutoUpdate = true
@@ -76,5 +73,9 @@ class ChunkManager {
7673
}
7774
this.cellMesh.clear()
7875
}
76+
77+
update () {
78+
TWEEN.update()
79+
}
7980
}
8081
export { ChunkManager }

src/scripts/world/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class World {
9191
}
9292

9393
updateChunksAroundPlayer (radius) {
94+
this.chunkManager.update()
9495
const pos = this.game.camera.position
9596
const cell = this.chunkTerrain.computeChunkForVoxel(
9697
Math.floor(pos.x + 0.5),

0 commit comments

Comments
 (0)