File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff 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}
8081export { ChunkManager }
Original file line number Diff line number Diff 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 ) ,
You can’t perform that action at this time.
0 commit comments