2020-10-31 15:11:25 -07:00
|
|
|
#ifndef VOXEL_GENERATOR_SCRIPT_H
|
|
|
|
#define VOXEL_GENERATOR_SCRIPT_H
|
|
|
|
|
|
|
|
#include "voxel_generator.h"
|
2021-12-13 13:38:10 -08:00
|
|
|
#include <core/object/script_language.h> // needed for GDVIRTUAL macro
|
|
|
|
#include <core/object/gdvirtual.gen.inc> // Also needed for GDVIRTUAL macro...
|
2020-10-31 15:11:25 -07:00
|
|
|
|
2021-01-16 05:41:46 -08:00
|
|
|
// Generator based on a script, like GDScript, C# or NativeScript.
|
|
|
|
// The script is expected to properly handle multithreading.
|
2020-10-31 15:11:25 -07:00
|
|
|
class VoxelGeneratorScript : public VoxelGenerator {
|
|
|
|
GDCLASS(VoxelGeneratorScript, VoxelGenerator)
|
|
|
|
public:
|
|
|
|
VoxelGeneratorScript();
|
|
|
|
|
2021-09-16 12:33:45 -07:00
|
|
|
Result generate_block(VoxelBlockRequest &input) override;
|
2020-10-31 15:11:25 -07:00
|
|
|
int get_used_channels_mask() const override;
|
|
|
|
|
2021-12-13 13:38:10 -08:00
|
|
|
protected:
|
|
|
|
GDVIRTUAL3(_generate_block, Ref<VoxelBuffer>, Vector3i, int)
|
|
|
|
GDVIRTUAL0RC(int, _get_used_channels_mask) // I think `C` means `const`?
|
|
|
|
|
2020-10-31 15:11:25 -07:00
|
|
|
private:
|
|
|
|
static void _bind_methods();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VOXEL_GENERATOR_SCRIPT_H
|