mirror of
https://github.com/Relintai/godot_voxel.git
synced 2024-11-19 02:47:18 +01:00
33 lines
804 B
C++
33 lines
804 B
C++
#ifndef VOXEL_PROVIDER_NOISE_H
|
|
#define VOXEL_PROVIDER_NOISE_H
|
|
|
|
#include "../util/float_buffer_3d.h"
|
|
#include "voxel_provider.h"
|
|
#include <modules/opensimplex/open_simplex_noise.h>
|
|
|
|
class VoxelProviderNoise : public VoxelProvider {
|
|
GDCLASS(VoxelProviderNoise, VoxelProvider)
|
|
public:
|
|
void set_noise(Ref<OpenSimplexNoise> noise);
|
|
Ref<OpenSimplexNoise> get_noise() const;
|
|
|
|
void set_height_start(real_t y);
|
|
real_t get_height_start() const;
|
|
|
|
void set_height_range(real_t hrange);
|
|
real_t get_height_range() const;
|
|
|
|
void emerge_block(Ref<VoxelBuffer> out_buffer, Vector3i origin_in_voxels, int lod);
|
|
|
|
protected:
|
|
static void _bind_methods();
|
|
|
|
private:
|
|
Ref<OpenSimplexNoise> _noise;
|
|
FloatBuffer3D _noise_buffer;
|
|
float _height_start = 0;
|
|
float _height_range = 300;
|
|
};
|
|
|
|
#endif // VOXEL_PROVIDER_NOISE_H
|