godot_voxel/streams/voxel_stream_image.h

30 lines
684 B
C
Raw Normal View History

2019-05-25 08:16:03 -07:00
#ifndef HEADER_VOXEL_STREAM_IMAGE
#define HEADER_VOXEL_STREAM_IMAGE
2019-05-25 08:16:03 -07:00
#include "voxel_stream.h"
#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)
public:
2019-05-25 08:07:38 -07:00
VoxelStreamImage();
void set_image(Ref<Image> im);
Ref<Image> get_image() const;
void set_channel(VoxelBuffer::ChannelId channel);
VoxelBuffer::ChannelId get_channel() const;
2019-04-29 13:57:39 -07:00
void emerge_block(Ref<VoxelBuffer> p_out_buffer, Vector3i origin_in_voxels, int lod);
private:
static void _bind_methods();
private:
Ref<Image> _image;
VoxelBuffer::ChannelId _channel;
};
2019-05-25 08:16:03 -07:00
#endif // HEADER_VOXEL_STREAM_IMAGE