2019-04-22 12:15:46 -07:00
|
|
|
#ifndef VOXEL_ISOSURFACE_TOOL_H
|
|
|
|
#define VOXEL_ISOSURFACE_TOOL_H
|
|
|
|
|
|
|
|
#include "voxel_buffer.h"
|
2019-04-23 18:08:45 -07:00
|
|
|
#include <core/image.h>
|
2019-04-22 12:15:46 -07:00
|
|
|
|
2019-09-03 14:54:40 -07:00
|
|
|
// TODO Will be obsoleted by VoxelTool
|
2019-04-22 12:15:46 -07:00
|
|
|
class VoxelIsoSurfaceTool : public Reference {
|
|
|
|
GDCLASS(VoxelIsoSurfaceTool, Reference)
|
|
|
|
public:
|
|
|
|
enum Operation {
|
|
|
|
OP_ADD = 0,
|
|
|
|
OP_SUBTRACT,
|
|
|
|
OP_SET
|
|
|
|
};
|
|
|
|
|
|
|
|
VoxelIsoSurfaceTool();
|
|
|
|
|
|
|
|
void set_buffer(Ref<VoxelBuffer> buffer);
|
|
|
|
Ref<VoxelBuffer> get_buffer() const;
|
|
|
|
|
|
|
|
void set_iso_scale(float iso_scale);
|
|
|
|
float get_iso_scale() const;
|
|
|
|
|
|
|
|
void set_offset(Vector3 offset);
|
|
|
|
Vector3 get_offset() const;
|
|
|
|
|
|
|
|
void do_sphere(Vector3 center, real_t radius, Operation op);
|
|
|
|
void do_plane(Plane plane, Operation op);
|
|
|
|
void do_cube(Transform transform, Vector3 extents, Operation op);
|
2019-04-23 18:08:45 -07:00
|
|
|
void do_heightmap(Ref<Image> heightmap, Vector3 offset, real_t vertical_scale, Operation op);
|
2019-04-22 12:15:46 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ref<VoxelBuffer> _buffer;
|
|
|
|
float _iso_scale;
|
|
|
|
Vector3 _offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
VARIANT_ENUM_CAST(VoxelIsoSurfaceTool::Operation)
|
|
|
|
|
|
|
|
#endif // VOXEL_ISOSURFACE_TOOL_H
|