From 1079a80bf88219581014e17a8e5bb86dff02389e Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Wed, 13 Oct 2021 21:03:59 +0100 Subject: [PATCH] Fixed (I hope) the error sometimes happening when using floating chunk separation --- doc/source/changelog.md | 1 + edition/voxel_tool_lod_terrain.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc/source/changelog.md b/doc/source/changelog.md index eef8847c..68caa729 100644 --- a/doc/source/changelog.md +++ b/doc/source/changelog.md @@ -29,6 +29,7 @@ Ongoing development - `master` - `VoxelMesherTransvoxel`: added option to simplify meshes using MeshOptimizer - `VoxelToolLodTerrain`: added `copy` function - `VoxelToolLodTerrain`: added `get_voxel_f_interpolated` function, useful to obtain interpolated SDF + - `VoxelToolLodTerrain`: added a function to separate floating chunks as rigid-bodies in a specified region - `VoxelInstanceGenerator`: added extra option to emit from faces more precisely, especially when meshes got simplified (slower than the other options) - `VoxelInstancer`: added menu to setup a multimesh item from a scene (similarly to GridMap), which also allows to set up colliders - `VoxelInstancer`: added initial support for instancing regular scenes (slower than multimeshes) diff --git a/edition/voxel_tool_lod_terrain.cpp b/edition/voxel_tool_lod_terrain.cpp index 593e8c8a..3dd16858 100644 --- a/edition/voxel_tool_lod_terrain.cpp +++ b/edition/voxel_tool_lod_terrain.cpp @@ -532,6 +532,10 @@ static Array separate_floating_chunks(VoxelTool &voxel_tool, Box3i world_box, No // because we build these buffers from connected groups that had negative SDF. ERR_CONTINUE(mesh.is_null()); + if (is_mesh_empty(mesh)) { + continue; + } + // DEBUG // { // Ref serializer;