922f361cb0
- Made a bunch of changes to comply with Godot 4 API - Use Godot's Vector3i and add the missing stuff with helper functions - Transvoxel uses custom attributes API, the old way would not work - Wrap MeshOptimizer in a unique namespace (see build script why) - Added clang-format file for the module as some rules now differ - Prevent thirdparty code and lookup tables from being clang-formatted - Very likely full of runtime bugs that need fixing
57 lines
1.2 KiB
C++
57 lines
1.2 KiB
C++
#ifndef VOXEL_NODE_H
|
|
#define VOXEL_NODE_H
|
|
|
|
#include "../generators/voxel_generator.h"
|
|
#include "../meshers/voxel_mesher.h"
|
|
#include "../streams/voxel_stream.h"
|
|
|
|
#include <scene/3d/node_3d.h>
|
|
|
|
// Base class for voxel volumes
|
|
class VoxelNode : public Node3D {
|
|
GDCLASS(VoxelNode, Node3D)
|
|
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;
|
|
|
|
virtual void set_generator(Ref<VoxelGenerator> generator);
|
|
virtual Ref<VoxelGenerator> get_generator() const;
|
|
|
|
virtual void restart_stream();
|
|
virtual void remesh_all_blocks();
|
|
|
|
virtual TypedArray<String> get_configuration_warnings() const override;
|
|
|
|
protected:
|
|
int get_used_channels_mask() const;
|
|
|
|
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);
|
|
}
|
|
|
|
Ref<VoxelGenerator> _b_get_generator() {
|
|
return get_generator();
|
|
}
|
|
void _b_set_generator(Ref<VoxelGenerator> g) {
|
|
set_generator(g);
|
|
}
|
|
|
|
static void _bind_methods();
|
|
};
|
|
|
|
#endif // VOXEL_NODE_H
|