2022-06-29 17:56:17 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
|
2022-06-29 19:28:08 +02:00
|
|
|
#include "BLI_function_ref.hh"
|
2023-02-06 21:25:45 +01:00
|
|
|
#include "BLI_math_matrix_types.hh"
|
2022-06-29 17:56:17 +02:00
|
|
|
#include "BLI_string_ref.hh"
|
|
|
|
|
|
|
|
#include "DNA_mesh_types.h"
|
|
|
|
#include "DNA_meshdata_types.h"
|
|
|
|
#include "DNA_modifier_types.h"
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
struct Volume;
|
|
|
|
struct VolumeGrid;
|
|
|
|
struct Depsgraph;
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
* \ingroup geo
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace blender::geometry {
|
|
|
|
|
|
|
|
struct MeshToVolumeResolution {
|
|
|
|
MeshToVolumeModifierResolutionMode mode;
|
|
|
|
union {
|
|
|
|
float voxel_size;
|
|
|
|
float voxel_amount;
|
|
|
|
} settings;
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef WITH_OPENVDB
|
2022-06-29 19:28:08 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \param bounds_fn: Return the bounds of the mesh positions,
|
|
|
|
* used for deciding the voxel size in "Amount" mode.
|
|
|
|
*/
|
2022-06-29 17:56:17 +02:00
|
|
|
float volume_compute_voxel_size(const Depsgraph *depsgraph,
|
2022-06-29 19:28:08 +02:00
|
|
|
FunctionRef<void(float3 &r_min, float3 &r_max)> bounds_fn,
|
2023-03-19 11:21:08 +01:00
|
|
|
MeshToVolumeResolution resolution,
|
2022-06-29 17:56:17 +02:00
|
|
|
float exterior_band_width,
|
|
|
|
const float4x4 &transform);
|
|
|
|
/**
|
2023-03-19 11:21:08 +01:00
|
|
|
* Add a new fog VolumeGrid to the Volume by converting the supplied mesh.
|
2022-06-29 17:56:17 +02:00
|
|
|
*/
|
2023-03-19 11:21:08 +01:00
|
|
|
VolumeGrid *fog_volume_grid_add_from_mesh(Volume *volume,
|
|
|
|
StringRefNull name,
|
|
|
|
const Mesh *mesh,
|
|
|
|
const float4x4 &mesh_to_volume_space_transform,
|
|
|
|
float voxel_size,
|
|
|
|
float interior_band_width,
|
|
|
|
float density);
|
|
|
|
/**
|
|
|
|
* Add a new SDF VolumeGrid to the Volume by converting the supplied mesh.
|
|
|
|
*/
|
|
|
|
VolumeGrid *sdf_volume_grid_add_from_mesh(
|
|
|
|
Volume *volume, StringRefNull name, const Mesh &mesh, float voxel_size, float half_band_width);
|
2022-06-29 17:56:17 +02:00
|
|
|
#endif
|
|
|
|
} // namespace blender::geometry
|