mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 09:57:26 +02:00
fix broken optimisation for skipping internal voxels when making collision hull
This commit is contained in:
parent
1ee773a532
commit
af11e97daa
1 changed files with 6 additions and 6 deletions
|
@ -696,12 +696,12 @@ void RenderablePolyVoxEntityItem::computeShapeInfo(ShapeInfo& info) {
|
||||||
for (int x = 0; x < _voxelVolumeSize.x; x++) {
|
for (int x = 0; x < _voxelVolumeSize.x; x++) {
|
||||||
if (getVoxel(x, y, z) > 0) {
|
if (getVoxel(x, y, z) > 0) {
|
||||||
|
|
||||||
if ((x > 0 && getVoxel(x - 1, y, z) == 0) &&
|
if ((x > 0 && getVoxel(x - 1, y, z) > 0) &&
|
||||||
(y > 0 && getVoxel(x, y - 1, z) == 0) &&
|
(y > 0 && getVoxel(x, y - 1, z) > 0) &&
|
||||||
(z > 0 && getVoxel(x, y, z - 1) == 0) &&
|
(z > 0 && getVoxel(x, y, z - 1) > 0) &&
|
||||||
(x < _voxelVolumeSize.x - 1 && getVoxel(x + 1, y, z) == 0) &&
|
(x < _voxelVolumeSize.x - 1 && getVoxel(x + 1, y, z) > 0) &&
|
||||||
(y < _voxelVolumeSize.y - 1 && getVoxel(x, y + 1, z) == 0) &&
|
(y < _voxelVolumeSize.y - 1 && getVoxel(x, y + 1, z) > 0) &&
|
||||||
(z < _voxelVolumeSize.z - 1 && getVoxel(x, y, z + 1) == 0)) {
|
(z < _voxelVolumeSize.z - 1 && getVoxel(x, y, z + 1) > 0)) {
|
||||||
// this voxel has neighbors in every cardinal direction, so there's no need
|
// this voxel has neighbors in every cardinal direction, so there's no need
|
||||||
// to include it in the collision hull.
|
// to include it in the collision hull.
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue