2019-05-25 08:07:38 -07:00
|
|
|
#ifndef VOXEL_STREAM_H
|
|
|
|
#define VOXEL_STREAM_H
|
2017-01-01 17:15:57 -08:00
|
|
|
|
2019-04-28 09:58:29 -07:00
|
|
|
#include "../voxel_buffer.h"
|
2019-04-23 17:29:47 -07:00
|
|
|
#include <core/resource.h>
|
2017-01-01 17:15:57 -08:00
|
|
|
|
2019-05-19 10:27:49 -07:00
|
|
|
// Provides access to a source of paged voxel data.
|
|
|
|
// Must be implemented in a multi-thread-safe way.
|
2019-05-25 08:07:38 -07:00
|
|
|
class VoxelStream : public Resource {
|
|
|
|
GDCLASS(VoxelStream, Resource)
|
2017-01-01 17:15:57 -08:00
|
|
|
public:
|
2019-04-29 13:57:39 -07:00
|
|
|
virtual void emerge_block(Ref<VoxelBuffer> out_buffer, Vector3i origin_in_voxels, int lod);
|
|
|
|
virtual void immerge_block(Ref<VoxelBuffer> buffer, Vector3i origin_in_voxels, int lod);
|
2017-01-01 17:15:57 -08:00
|
|
|
|
2019-05-27 16:40:09 -07:00
|
|
|
virtual bool is_thread_safe() const;
|
|
|
|
virtual bool is_cloneable() const;
|
|
|
|
|
2017-01-01 17:15:57 -08:00
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
2019-04-29 13:57:39 -07:00
|
|
|
void _emerge_block(Ref<VoxelBuffer> out_buffer, Vector3 origin_in_voxels, int lod);
|
|
|
|
void _immerge_block(Ref<VoxelBuffer> buffer, Vector3 origin_in_voxels, int lod);
|
2017-01-01 17:15:57 -08:00
|
|
|
};
|
|
|
|
|
2019-05-25 08:16:03 -07:00
|
|
|
#endif // VOXEL_STREAM_H
|