2020-12-18 14:58:41 -08:00
|
|
|
#ifndef VOXEL_NODE_H
|
|
|
|
#define VOXEL_NODE_H
|
|
|
|
|
2021-03-21 11:48:00 -07:00
|
|
|
#include "../generators/voxel_generator.h"
|
|
|
|
#include "../meshers/voxel_mesher.h"
|
|
|
|
#include "../streams/voxel_stream.h"
|
2020-12-18 14:58:41 -08:00
|
|
|
|
2021-03-21 11:48:00 -07:00
|
|
|
#include <scene/3d/spatial.h>
|
2020-12-18 14:58:41 -08:00
|
|
|
|
|
|
|
// Base class for voxel volumes
|
|
|
|
class VoxelNode : public Spatial {
|
|
|
|
GDCLASS(VoxelNode, Spatial)
|
|
|
|
public:
|
|
|
|
virtual void set_mesher(Ref<VoxelMesher> mesher);
|
|
|
|
virtual Ref<VoxelMesher> get_mesher() const;
|
|
|
|
|
|
|
|
virtual void set_stream(Ref<VoxelStream> stream);
|
|
|
|
virtual Ref<VoxelStream> get_stream() const;
|
|
|
|
|
2021-01-17 09:18:05 -08:00
|
|
|
virtual void set_generator(Ref<VoxelGenerator> generator);
|
|
|
|
virtual Ref<VoxelGenerator> get_generator() const;
|
|
|
|
|
2020-12-18 14:58:41 -08:00
|
|
|
virtual void restart_stream();
|
|
|
|
virtual void remesh_all_blocks();
|
|
|
|
|
2021-05-15 15:41:19 -07:00
|
|
|
virtual String get_configuration_warning() const override;
|
2020-12-18 14:58:41 -08:00
|
|
|
|
2021-01-17 09:18:05 -08:00
|
|
|
protected:
|
|
|
|
int get_used_channels_mask() const;
|
|
|
|
|
2020-12-18 14:58:41 -08:00
|
|
|
private:
|
|
|
|
Ref<VoxelMesher> _b_get_mesher() { return get_mesher(); }
|
|
|
|
void _b_set_mesher(Ref<VoxelMesher> mesher) { set_mesher(mesher); }
|
|
|
|
|
|
|
|
Ref<VoxelStream> _b_get_stream() { return get_stream(); }
|
|
|
|
void _b_set_stream(Ref<VoxelStream> stream) { set_stream(stream); }
|
|
|
|
|
2021-01-17 09:18:05 -08:00
|
|
|
Ref<VoxelGenerator> _b_get_generator() { return get_generator(); }
|
|
|
|
void _b_set_generator(Ref<VoxelGenerator> g) { set_generator(g); }
|
|
|
|
|
2020-12-18 14:58:41 -08:00
|
|
|
static void _bind_methods();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VOXEL_NODE_H
|