2017-01-02 14:58:51 -08:00
|
|
|
#ifndef VOXEL_PROVIDER_TEST_H
|
|
|
|
#define VOXEL_PROVIDER_TEST_H
|
|
|
|
|
|
|
|
#include "voxel_provider.h"
|
|
|
|
|
|
|
|
class VoxelProviderTest : public VoxelProvider {
|
2017-03-24 17:23:36 -07:00
|
|
|
GDCLASS(VoxelProviderTest, VoxelProvider)
|
2017-01-02 14:58:51 -08:00
|
|
|
|
|
|
|
public:
|
|
|
|
enum Mode {
|
|
|
|
MODE_FLAT,
|
|
|
|
MODE_WAVES
|
|
|
|
};
|
|
|
|
|
|
|
|
VoxelProviderTest();
|
|
|
|
|
2019-04-29 13:57:39 -07:00
|
|
|
virtual void emerge_block(Ref<VoxelBuffer> out_buffer, Vector3i origin, int lod);
|
2017-01-02 14:58:51 -08:00
|
|
|
|
|
|
|
void set_mode(Mode mode);
|
|
|
|
Mode get_mode() const { return _mode; }
|
|
|
|
|
|
|
|
void set_voxel_type(int t);
|
|
|
|
int get_voxel_type() const;
|
|
|
|
|
|
|
|
Vector3i get_pattern_size() const { return _pattern_size; }
|
|
|
|
void set_pattern_size(Vector3i size);
|
|
|
|
|
|
|
|
Vector3i get_pattern_offset() const { return _pattern_offset; }
|
|
|
|
void set_pattern_offset(Vector3i offset);
|
|
|
|
|
|
|
|
protected:
|
2019-04-29 13:57:39 -07:00
|
|
|
void generate_block_flat(VoxelBuffer &out_buffer, Vector3i origin, int lod);
|
|
|
|
void generate_block_waves(VoxelBuffer &out_buffer, Vector3i origin, int lod);
|
2017-01-02 14:58:51 -08:00
|
|
|
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
Vector3 _get_pattern_size() const { return get_pattern_size().to_vec3(); }
|
|
|
|
void _set_pattern_size(Vector3 size) { set_pattern_size(Vector3i(size)); }
|
|
|
|
|
|
|
|
Vector3 _get_pattern_offset() const { return get_pattern_offset().to_vec3(); }
|
|
|
|
void _set_pattern_offset(Vector3 offset) { set_pattern_offset(Vector3i(offset)); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
Mode _mode;
|
|
|
|
int _voxel_type;
|
|
|
|
Vector3i _pattern_offset;
|
|
|
|
Vector3i _pattern_size;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VOXEL_PROVIDER_TEST_H
|