2019-09-03 22:54:40 +01:00
|
|
|
#ifndef VOXEL_TOOL_BUFFER_H
|
|
|
|
#define VOXEL_TOOL_BUFFER_H
|
|
|
|
|
|
|
|
#include "voxel_tool.h"
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2021-05-31 17:10:54 +01:00
|
|
|
bool is_area_editable(const Box3i &box) const override;
|
2021-09-24 02:09:58 +01:00
|
|
|
void paste(Vector3i p_pos, Ref<VoxelBuffer> p_voxels, uint8_t channels_mask, bool use_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;
|
2021-09-09 18:52:00 +01:00
|
|
|
Variant get_voxel_metadata(Vector3i pos) const override;
|
2020-08-10 19:03:01 +01:00
|
|
|
|
2021-04-25 20:23:14 +01:00
|
|
|
void do_sphere(Vector3 center, float radius) 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;
|
2021-05-31 17:10:54 +01:00
|
|
|
void _post_edit(const Box3i &box) override;
|
2019-09-03 22:54:40 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ref<VoxelBuffer> _buffer;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VOXEL_TOOL_BUFFER_H
|