Added `copy` to VoxelToolLodTerrain

master
Marc Gilleron 2021-07-10 20:19:44 +01:00
parent 144affe42d
commit 3ffd07af47
2 changed files with 11 additions and 0 deletions

View File

@ -173,6 +173,15 @@ void VoxelToolLodTerrain::do_sphere(Vector3 center, float radius) {
_post_edit(box);
}
void VoxelToolLodTerrain::copy(Vector3i pos, Ref<VoxelBuffer> dst, uint8_t channels_mask) {
ERR_FAIL_COND(_terrain == nullptr);
ERR_FAIL_COND(dst.is_null());
if (channels_mask == 0) {
channels_mask = (1 << _channel);
}
_map->copy(pos, **dst, channels_mask);
}
float VoxelToolLodTerrain::get_voxel_f_interpolated(Vector3 position) const {
ERR_FAIL_COND_V(_terrain == nullptr, 0);
const VoxelDataMap *map = _map;

View File

@ -20,6 +20,8 @@ public:
void do_sphere(Vector3 center, float radius) override;
void copy(Vector3i pos, Ref<VoxelBuffer> dst, uint8_t channels_mask) override;
// Specialized API
float get_voxel_f_interpolated(Vector3 position) const;