Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/geometry/intern/mesh_to_volume.cc')
-rw-r--r--source/blender/geometry/intern/mesh_to_volume.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/geometry/intern/mesh_to_volume.cc b/source/blender/geometry/intern/mesh_to_volume.cc
index 93a424f9a94..ae98b048a6c 100644
--- a/source/blender/geometry/intern/mesh_to_volume.cc
+++ b/source/blender/geometry/intern/mesh_to_volume.cc
@@ -64,8 +64,7 @@ void OpenVDBMeshAdapter::getIndexSpacePoint(size_t polygon_index,
}
float volume_compute_voxel_size(const Depsgraph *depsgraph,
- const float3 &bb_min,
- const float3 &bb_max,
+ FunctionRef<void(float3 &r_min, float3 &r_max)> bounds_fn,
const MeshToVolumeResolution res,
const float exterior_band_width,
const float4x4 &transform)
@@ -81,6 +80,11 @@ float volume_compute_voxel_size(const Depsgraph *depsgraph,
if (res.settings.voxel_amount <= 0) {
return 0;
}
+
+ float3 bb_min;
+ float3 bb_max;
+ bounds_fn(bb_min, bb_max);
+
/* Compute the voxel size based on the desired number of voxels and the approximated bounding
* box of the volume. */
const float diagonal = math::distance(transform * bb_max, transform * bb_min);