godot_voxel/edition/voxel_tool_buffer.h

37 lines
986 B
C
Raw Normal View History

2019-09-03 22:54:40 +01:00
#ifndef VOXEL_TOOL_BUFFER_H
#define VOXEL_TOOL_BUFFER_H
#include "voxel_tool.h"
2022-01-09 22:13:10 +00:00
namespace zylann::voxel {
2019-09-03 22:54:40 +01:00
class VoxelToolBuffer : public VoxelTool {
GDCLASS(VoxelToolBuffer, VoxelTool)
public:
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;
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
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;
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;
};
2022-01-09 22:13:10 +00:00
} // namespace zylann::voxel
2019-09-03 22:54:40 +01:00
#endif // VOXEL_TOOL_BUFFER_H