2019-09-03 22:54:40 +01:00
|
|
|
#ifndef VOXEL_TOOL_BUFFER_H
|
|
|
|
#define VOXEL_TOOL_BUFFER_H
|
|
|
|
|
|
|
|
#include "voxel_tool.h"
|
|
|
|
|
2019-09-05 19:43:25 +01:00
|
|
|
class VoxelBuffer;
|
|
|
|
|
2019-09-03 22:54:40 +01:00
|
|
|
class VoxelToolBuffer : public VoxelTool {
|
|
|
|
GDCLASS(VoxelToolBuffer, VoxelTool)
|
|
|
|
public:
|
2021-01-17 22:18:41 +00:00
|
|
|
VoxelToolBuffer() {}
|
2019-09-03 22:54:40 +01:00
|
|
|
VoxelToolBuffer(Ref<VoxelBuffer> vb);
|
|
|
|
|
|
|
|
bool is_area_editable(const Rect3i &box) const override;
|
2021-02-21 18:22:40 +00:00
|
|
|
void paste(Vector3i p_pos, Ref<VoxelBuffer> p_voxels, uint8_t channels_mask, uint64_t mask_value) override;
|
2019-09-03 22:54:40 +01:00
|
|
|
|
2020-08-10 19:03:01 +01:00
|
|
|
void set_voxel_metadata(Vector3i pos, Variant meta) override;
|
|
|
|
Variant get_voxel_metadata(Vector3i pos) override;
|
|
|
|
|
2019-09-03 22:54:40 +01:00
|
|
|
protected:
|
2020-12-30 20:09:31 +00:00
|
|
|
uint64_t _get_voxel(Vector3i pos) const override;
|
|
|
|
float _get_voxel_f(Vector3i pos) const override;
|
2020-08-06 19:54:47 +01:00
|
|
|
void _set_voxel(Vector3i pos, uint64_t v) override;
|
2019-09-03 22:54:40 +01:00
|
|
|
void _set_voxel_f(Vector3i pos, float v) override;
|
|
|
|
void _post_edit(const Rect3i &box) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ref<VoxelBuffer> _buffer;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VOXEL_TOOL_BUFFER_H
|