2019-05-25 08:16:03 -07:00
|
|
|
#ifndef HEADER_VOXEL_STREAM_IMAGE
|
|
|
|
#define HEADER_VOXEL_STREAM_IMAGE
|
2018-09-27 17:11:28 -07:00
|
|
|
|
2019-05-25 08:16:03 -07:00
|
|
|
#include "voxel_stream.h"
|
2018-09-27 17:11:28 -07:00
|
|
|
#include <core/image.h>
|
|
|
|
|
|
|
|
// Provides infinite tiling heightmap based on an image
|
2019-05-25 08:07:38 -07:00
|
|
|
class VoxelStreamImage : public VoxelStream {
|
|
|
|
GDCLASS(VoxelStreamImage, VoxelStream)
|
2018-09-27 17:11:28 -07:00
|
|
|
public:
|
2019-05-25 08:07:38 -07:00
|
|
|
VoxelStreamImage();
|
2018-09-27 17:11:28 -07:00
|
|
|
|
|
|
|
void set_image(Ref<Image> im);
|
|
|
|
Ref<Image> get_image() const;
|
|
|
|
|
2019-04-24 16:54:14 -07:00
|
|
|
void set_channel(VoxelBuffer::ChannelId channel);
|
2019-05-29 16:46:08 -07:00
|
|
|
VoxelBuffer::ChannelId get_channel() const;
|
2018-09-27 17:11:28 -07:00
|
|
|
|
2019-04-29 13:57:39 -07:00
|
|
|
void emerge_block(Ref<VoxelBuffer> p_out_buffer, Vector3i origin_in_voxels, int lod);
|
2018-09-27 17:11:28 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ref<Image> _image;
|
2019-05-29 16:46:08 -07:00
|
|
|
VoxelBuffer::ChannelId _channel;
|
2018-09-27 17:11:28 -07:00
|
|
|
};
|
|
|
|
|
2019-05-25 08:16:03 -07:00
|
|
|
#endif // HEADER_VOXEL_STREAM_IMAGE
|