godot_voxel/edition/voxel_tool_lod_terrain.h

37 lines
1.0 KiB
C
Raw Normal View History

2019-09-03 22:54:40 +01:00
#ifndef VOXEL_TOOL_LOD_TERRAIN_H
#define VOXEL_TOOL_LOD_TERRAIN_H
2019-09-05 19:43:25 +01:00
#include "voxel_tool.h"
2019-09-03 22:54:40 +01:00
class VoxelLodTerrain;
2019-09-05 19:43:25 +01:00
class VoxelMap;
2019-09-03 22:54:40 +01:00
class VoxelToolLodTerrain : public VoxelTool {
GDCLASS(VoxelToolLodTerrain, VoxelTool)
public:
VoxelToolLodTerrain() {}
VoxelToolLodTerrain(VoxelLodTerrain *terrain, VoxelMap &map);
2019-09-03 22:54:40 +01:00
bool is_area_editable(const Rect3i &box) const override;
Ref<VoxelRaycastResult> raycast(Vector3 pos, Vector3 dir, float max_distance, uint32_t collision_mask) override;
int get_raycast_binary_search_iterations() const;
void set_raycast_binary_search_iterations(int iterations);
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;
void _post_edit(const Rect3i &box) override;
private:
static void _bind_methods();
2019-09-03 22:54:40 +01:00
VoxelLodTerrain *_terrain = nullptr;
VoxelMap *_map = nullptr;
int _raycast_binary_search_iterations = 0;
2019-09-03 22:54:40 +01:00
};
#endif // VOXEL_TOOL_LOD_TERRAIN_H