mirror of
https://github.com/Relintai/godot_voxel.git
synced 2024-11-11 20:35:08 +01:00
Return empty mesh if blocky mesher doesnt find a type channel
This commit is contained in:
parent
fdb40ef3f4
commit
9e13c68da7
@ -129,7 +129,12 @@ Array VoxelMesher::build(const VoxelBuffer &buffer, unsigned int channel, Vector
|
||||
// | | )
|
||||
// \ | |
|
||||
// \ /
|
||||
CRASH_COND(type_buffer == NULL);
|
||||
if (type_buffer == nullptr) {
|
||||
// No data to read, the channel is probably uniform
|
||||
// TODO This is an invalid behavior IF sending a full block of uniformly opaque cubes,
|
||||
// however not likely for terrains because with neighbor padding, such a case means no face would be generated anyways
|
||||
return Array();
|
||||
}
|
||||
|
||||
//CRASH_COND(memarr_len(type_buffer) != buffer.get_volume() * sizeof(uint8_t));
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <core/reference.h>
|
||||
#include <scene/resources/mesh.h>
|
||||
|
||||
// TODO Should be renamed VoxelMesherModel or something like that
|
||||
// TODO Should be renamed VoxelMesherBlocky or something like that
|
||||
class VoxelMesher : public Reference {
|
||||
GDCLASS(VoxelMesher, Reference)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user