Wayverb
mesh.h
1 #pragma once
2 
3 #include "waveguide/mesh_descriptor.h"
4 #include "waveguide/setup.h"
5 
6 #include "core/gpu_scene_data.h"
7 #include "core/spatial_division/voxelised_scene_data.h"
8 
9 namespace wayverb {
10 namespace waveguide {
11 
12 class mesh final {
13 public:
14  mesh(mesh_descriptor descriptor, vectors vectors);
15 
16  const mesh_descriptor& get_descriptor() const;
17  const vectors& get_structure() const;
18 
19  void set_coefficients(coefficients_canonical coefficients);
20  void set_coefficients(
21  util::aligned::vector<coefficients_canonical> coefficients);
22 
23 private:
24  mesh_descriptor descriptor_;
25  vectors vectors_;
26 };
27 
30 double estimate_volume(const mesh& mesh);
31 
32 bool is_inside(const mesh& m, size_t node_index);
33 
35 mesh compute_mesh(
36  const core::compute_context& cc,
37  const core::voxelised_scene_data<cl_float3,
39  voxelised,
40  float mesh_spacing,
41  float speed_of_sound);
42 
43 struct voxels_and_mesh final {
45  voxels;
46  mesh mesh;
47 };
48 
51 voxels_and_mesh compute_voxels_and_mesh(
52  const core::compute_context& cc,
53  const core::gpu_scene_data& scene,
54  const glm::vec3& anchor, // probably the receiver if you want it to
55  // coincide with an actual node
56  double sample_rate,
57  double speed_of_sound);
58 
59 } // namespace waveguide
60 } // namespace wayverb
Definition: scene_data.h:13
IIR filter coefficient storage.
Definition: filter_structs.h:40
Definition: mesh.h:12
Definition: setup.h:27
Definition: capsule_base.h:9
invariant: device is a valid device for the context
Definition: common.h:13
Definition: voxelised_scene_data.h:14
Definition: mesh_descriptor.h:14