2019-04-22 21:15:46 +02:00
|
|
|
#ifndef VOXEL_ISOSURFACE_TOOL_H
|
|
|
|
#define VOXEL_ISOSURFACE_TOOL_H
|
|
|
|
|
|
|
|
#include "voxel_buffer.h"
|
2019-04-24 03:08:45 +02:00
|
|
|
#include <core/image.h>
|
2019-04-22 21:15:46 +02: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-24 03:08:45 +02:00
|
|
|
void do_heightmap(Ref<Image> heightmap, Vector3 offset, real_t vertical_scale, Operation op);
|
2019-04-22 21:15:46 +02: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
|