|
JPL Spatial
Sound spatialization and propagation library
|
#include <JPLSpatial/PathTracing/SpecularRayTracing.h>
Static Public Attributes | |
| static constexpr std::size_t | cMaxOrder = 16 |
Specular Ray Tracing algorithm. Supporting backtracing - tracing from the listener. And bidirectional tracing - from the listener and sources.
Example backtracing from the listener:
// Step 1. Trace paths from the listener's postiion
MySceneType scenInterface;
Vec3 listenerPosition = ...;
TraceParameters parameters = ...;
TraceResults outTraceResults;
SpecularRayTracing::Trace(scenInterface, listenerPosition, parameters, outTraceResults)
// Step 2. Process traces
SourceData sourceData{ listenerPosition, listenerId };
std::span<ReceiverData> receiverData = ... // per sound source { position, Id }
std::span<SpecularPathCache*> specularPathCache = ... // per sound source SPC
SpecularRayTracing::ProcessTraces(scenInterface, sourceData, outTraceResults, receiversData, specularPathCache);
// Step 3. Make early reflection taps from SpecularPathCache
...
For bidirectional traces: 1) Do Step 1 from above for listener and for each source.
false 2) Use second SpecularRayTracing::ProcessTraces overload that takes span of receiver traces.
|
inlinestatic |
Process bidirectional traces, connect source paths with receivers and receiver paths with the source.
Note: here source is assumed to be listener and thus the Image Sources are constructed from the receivers.
| sourceData | data for the source of the traces |
| receiverData | data for the receivers of the traces |
| sourceTraces | traces done from the source position |
| receiverTraces | traces done from the positions of receivers |
| SpecularPathCacheContainer | must have operator[] overloaded to access cache for a receiver index |
|
inlinestatic |
Process traces from source direction, connect paths to receivers.
Note: here source is assumed to be listener and thus the Image Sources are constructed from the receivers.
| sourceData | data for the source of the traces |
| receiverData | data for the receiver of the traces |
| traces | traces done from the source position |
| SpecularPathCacheContainer | must have operator[] overloaded to access cache for a receiver index |
|
inlinestatic |
Trace paths from origin based on TraceParameters. This can be used to trace from the listener and sources.
| bPathHashCombine | if set to true, hash of each node is a combination "up to" this node, otherwise it's a hash of this particular intersection. |
|
staticconstexpr |