From af11e97daad8d8aa4a5c06e8d8cf7f59c683debb Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 17 Aug 2015 08:49:00 -0700 Subject: [PATCH] fix broken optimisation for skipping internal voxels when making collision hull --- .../src/RenderablePolyVoxEntityItem.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp index edccffd397..5c0a7888e5 100644 --- a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp @@ -696,12 +696,12 @@ void RenderablePolyVoxEntityItem::computeShapeInfo(ShapeInfo& info) { for (int x = 0; x < _voxelVolumeSize.x; x++) { if (getVoxel(x, y, z) > 0) { - if ((x > 0 && getVoxel(x - 1, y, z) == 0) && - (y > 0 && getVoxel(x, y - 1, z) == 0) && - (z > 0 && getVoxel(x, y, z - 1) == 0) && - (x < _voxelVolumeSize.x - 1 && getVoxel(x + 1, y, z) == 0) && - (y < _voxelVolumeSize.y - 1 && getVoxel(x, y + 1, z) == 0) && - (z < _voxelVolumeSize.z - 1 && getVoxel(x, y, z + 1) == 0)) { + if ((x > 0 && getVoxel(x - 1, y, z) > 0) && + (y > 0 && getVoxel(x, y - 1, z) > 0) && + (z > 0 && getVoxel(x, y, z - 1) > 0) && + (x < _voxelVolumeSize.x - 1 && getVoxel(x + 1, y, z) > 0) && + (y < _voxelVolumeSize.y - 1 && getVoxel(x, y + 1, z) > 0) && + (z < _voxelVolumeSize.z - 1 && getVoxel(x, y, z + 1) > 0)) { // this voxel has neighbors in every cardinal direction, so there's no need // to include it in the collision hull. continue;