godot_voxel/dmc/voxel_mesher_dmc.h
Marc Gilleron 91a5c7ffa8 A bit of reorganization and tweaks:
- Moved HermiteValue in its own file
- VoxelBuffer channels are now predefined
- Create DualGridGenerator for easier passing of data
- Chunk size is no longer hardcoded
- Respect padding when polygonizing voxels
- BUG: due to the above, the way we build the octree is now breaking the result as mentionned in the TODO
2019-04-21 19:31:35 +01:00

31 lines
666 B
C++

#ifndef VOXEL_MESHER_DMC_H
#define VOXEL_MESHER_DMC_H
#include "../voxel_buffer.h"
#include "mesh_builder.h"
#include "scene/resources/mesh.h"
class VoxelMesherDMC : public Reference {
GDCLASS(VoxelMesherDMC, Reference)
public:
enum Mode {
MODE_NORMAL,
MODE_WIREFRAME,
MODE_DEBUG_OCTREE,
MODE_DEBUG_DUAL_GRID
};
Ref<ArrayMesh> build_mesh(const VoxelBuffer &voxels, real_t geometric_error, Mode mode);
protected:
static void _bind_methods();
Ref<ArrayMesh> _build_mesh_b(Ref<VoxelBuffer> voxels, real_t geometric_error, Mode mode);
private:
dmc::MeshBuilder _mesh_builder;
};
VARIANT_ENUM_CAST(VoxelMesherDMC::Mode)
#endif // VOXEL_MESHER_DMC_H