mirror of
https://github.com/Relintai/godot_voxel.git
synced 2025-01-12 20:01:18 +01:00
91a5c7ffa8
- 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
31 lines
666 B
C++
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
|