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
27 lines
841 B
C++
27 lines
841 B
C++
#ifndef VOXEL_GENERATOR_SCRIPT_H
|
|
#define VOXEL_GENERATOR_SCRIPT_H
|
|
|
|
#include "voxel_generator.h"
|
|
#include <core/object/script_language.h> // needed for GDVIRTUAL macro
|
|
#include <core/object/gdvirtual.gen.inc> // Also needed for GDVIRTUAL macro...
|
|
|
|
// Generator based on a script, like GDScript, C# or NativeScript.
|
|
// The script is expected to properly handle multithreading.
|
|
class VoxelGeneratorScript : public VoxelGenerator {
|
|
GDCLASS(VoxelGeneratorScript, VoxelGenerator)
|
|
public:
|
|
VoxelGeneratorScript();
|
|
|
|
Result generate_block(VoxelBlockRequest &input) override;
|
|
int get_used_channels_mask() const override;
|
|
|
|
protected:
|
|
GDVIRTUAL3(_generate_block, Ref<VoxelBuffer>, Vector3i, int)
|
|
GDVIRTUAL0RC(int, _get_used_channels_mask) // I think `C` means `const`?
|
|
|
|
private:
|
|
static void _bind_methods();
|
|
};
|
|
|
|
#endif // VOXEL_GENERATOR_SCRIPT_H
|