mirror of
https://github.com/Relintai/godot_voxel.git
synced 2024-11-11 20:35:08 +01:00
42 lines
866 B
C++
42 lines
866 B
C++
#ifndef VOXEL_ISOSURFACE_TOOL_H
|
|
#define VOXEL_ISOSURFACE_TOOL_H
|
|
|
|
#include "voxel_buffer.h"
|
|
|
|
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);
|
|
|
|
protected:
|
|
static void _bind_methods();
|
|
|
|
private:
|
|
Ref<VoxelBuffer> _buffer;
|
|
float _iso_scale;
|
|
Vector3 _offset;
|
|
};
|
|
|
|
VARIANT_ENUM_CAST(VoxelIsoSurfaceTool::Operation)
|
|
|
|
#endif // VOXEL_ISOSURFACE_TOOL_H
|