RavEngine
Loading...
Searching...
No Matches
path_tracer.h
1
/*
2
Copyright 2018 Google Inc. All Rights Reserved.
3
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
8
http://www.apache.org/licenses/LICENSE-2.0
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS-IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16
17
#ifndef RESONANCE_AUDIO_GEOMETRICAL_ACOUSTICS_PATH_TRACER_H_
18
#define RESONANCE_AUDIO_GEOMETRICAL_ACOUSTICS_PATH_TRACER_H_
19
20
#include <functional>
21
#include <vector>
22
23
#include "geometrical_acoustics/acoustic_source.h"
24
#include "geometrical_acoustics/path.h"
25
#include "geometrical_acoustics/scene_manager.h"
26
27
namespace
vraudio {
28
29
// A wrapper around Embree that finds sound propagation paths from a source.
30
class
PathTracer
{
31
public
:
32
// Constructor.
33
//
34
// @param scene_manager Scene manager.
35
explicit
PathTracer
(
const
SceneManager
& scene_manager)
36
: scene_manager_(scene_manager) {}
37
~PathTracer
() {}
38
39
// Traces sound propagation paths from a source.
40
//
41
// @param source Source from which paths are traced.
42
// @param min_num_rays Minimum number of rays to be traced.
43
// @param max_depth Maximum depth of tracing performed along a path. The
44
// tracing stops when reading |max_depth| interactions with the scene
45
// geometries.
46
// @param energy_threshold Energy threshold below which the tracing stops.
47
// @return Vector of at least |min_num_rays| traced paths.
48
std::vector<Path> TracePaths(
const
AcousticSource
& source,
49
size_t
min_num_rays,
size_t
max_depth,
50
float
energy_threshold);
51
52
private
:
53
// Scene manager.
54
const
SceneManager
& scene_manager_;
55
};
56
57
}
// namespace vraudio
58
59
#endif
// RESONANCE_AUDIO_GEOMETRICAL_ACOUSTICS_PATH_TRACER_H_
vraudio::AcousticSource
Definition
acoustic_source.h:34
vraudio::PathTracer
Definition
path_tracer.h:30
vraudio::SceneManager
Definition
scene_manager.h:36
RavEngine
deps
resonance-audio
resonance_audio
geometrical_acoustics
path_tracer.h
Generated by
1.9.8