godot_voxel/voxel_tool_buffer.h

27 lines
601 B
C
Raw Normal View History

2019-09-03 14:54:40 -07:00
#ifndef VOXEL_TOOL_BUFFER_H
#define VOXEL_TOOL_BUFFER_H
#include "voxel_tool.h"
2019-09-05 11:43:25 -07:00
class VoxelBuffer;
2019-09-03 14:54:40 -07:00
class VoxelToolBuffer : public VoxelTool {
GDCLASS(VoxelToolBuffer, VoxelTool)
public:
VoxelToolBuffer(Ref<VoxelBuffer> vb);
bool is_area_editable(const Rect3i &box) const override;
protected:
int _get_voxel(Vector3i pos) override;
float _get_voxel_f(Vector3i pos) override;
void _set_voxel(Vector3i pos, int v) override;
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