From 216be651f223ff896067239e2907dbb0361112c9 Mon Sep 17 00:00:00 2001 From: deathcap Date: Sun, 25 May 2014 18:48:05 -0700 Subject: [PATCH] Add chunkPad option, update to voxel-mesher ^0.11.0 --- index.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1b11ed2..f32781c 100644 --- a/index.js +++ b/index.js @@ -59,6 +59,7 @@ function Game(opts) { this.arrayType = opts.arrayType || {1:Uint8Array, 2:Uint16Array, 4:Uint32Array}[opts.arrayTypeSize] || Uint8Array this.cubeSize = 1 // backwards compat this.chunkSize = opts.chunkSize || 32 + this.chunkPad = opts.chunkPad || 4 // chunkDistance and removeDistance should not be set to the same thing // as it causes lag when you go back and forth on a chunk boundary @@ -629,7 +630,7 @@ Game.prototype.showChunk = function(chunk, optionalPosition) { //console.log('showChunk',chunkIndex,'density=',JSON.stringify(chunkDensity(chunk))) var voxelArray = isndarray(chunk) ? chunk : ndarray(chunk.voxels, chunk.dims) - var mesh = this.mesherPlugin.createVoxelMesh(this.shell.gl, voxelArray, this.stitcher.voxelSideTextureIDs, this.stitcher.voxelSideTextureSizes, chunk.position) + var mesh = this.mesherPlugin.createVoxelMesh(this.shell.gl, voxelArray, this.stitcher.voxelSideTextureIDs, this.stitcher.voxelSideTextureSizes, chunk.position, this.chunkPad) if (!mesh) { // no voxels diff --git a/package.json b/package.json index d066f10..1e4f686 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "Mikola Lysenko (https://github.com/mikolalysenko/)" ], "dependencies": { - "voxel-mesher": "^0.10.0", + "voxel-mesher": "^0.11.0", "voxel-shader": "^0.11.0", "gl-now": "^1.3.0", "ndarray": "^1.0.10",