AcousticTracer 0.1.0
An acoustic raytracing library.
Loading...
Searching...
No Matches
at.h
Go to the documentation of this file.
1
5#ifndef AT_H
6#define AT_H
7
8#include "acoustic/at_math.h"
9#include <stdint.h>
10#include <stddef.h>
11
15
16typedef struct AT_Model AT_Model;
17typedef struct AT_Scene AT_Scene;
18typedef struct AT_Simulation AT_Simulation;
19
31
37typedef enum {
38 AT_MATERIAL_CONCRETE,
39 AT_MATERIAL_PLASTIC,
40 AT_MATERIAL_WOOD,
41 AT_MATERIAL_COUNT,
43
47typedef struct {
48 float absorption;
49 float scattering;
51
60
65typedef struct {
67 uint32_t num_sources;
69
70 // Borrowed: must remain valid for the entire lifetime of the scene
73
77typedef struct {
78 float voxel_size;
79 uint32_t num_rays;
80 uint8_t fps;
82
83// Model
85 AT_Model **out_model,
86 const char *filepath
87);
88
90 AT_Model *model
91);
92
94 AT_AABB *out_aabb,
95 const AT_Model *model
96);
97
98// Scene
100 AT_Scene **out_scene,
101 const AT_SceneConfig *config
102);
103
105 AT_Scene *scene
106);
107
108// Simulation
109// Creates the simulation "object" and allocates voxel memory
111 AT_Simulation **out_simulation,
112 const AT_Scene *scene,
113 const AT_Settings *settings
114);
115
116// Runs the actual simulation and updates voxel bins etc..
118 AT_Simulation *simulation
119);
120
122 AT_Simulation *simulation
123);
124
125#endif // AT_H
AT_Result AT_simulation_run(AT_Simulation *simulation)
Starts the simulation.
void AT_simulation_destroy(AT_Simulation *simulation)
Destroys an allocated AT_Simulation.
AT_Result AT_simulation_create(AT_Simulation **out_simulation, const AT_Scene *scene, const AT_Settings *settings)
AT_Simulation constructor using defined AT_Settings.
void AT_scene_destroy(AT_Scene *scene)
Destroys an allocated AT_Scene.
AT_Result AT_model_create(AT_Model **out_model, const char *filepath)
AT_Model constructor for a given glb filepath.
void AT_model_destroy(AT_Model *model)
Destroys an allocated AT_Model.
void AT_model_to_AABB(AT_AABB *out_aabb, const AT_Model *model)
Calculates the min and max of a model for AABB collision.
@ AT_ERR_NETWORK_FAILURE
Definition at.h:29
@ AT_OK
Definition at.h:25
@ AT_ERR_ALLOC_ERROR
Definition at.h:28
@ AT_ERR_INVALID_ARGUMENT
Definition at.h:26
AT_Triangle, AT_Vec3 and related functions.
AT_MaterialType
Defines possible material types.
Definition at.h:37
AT_Result
Defines possible result types.
Definition at.h:24
AT_Result AT_scene_create(AT_Scene **out_scene, const AT_SceneConfig *config)
AT_Scene constructor for a given AT_SceneConfig.
Axis-Aligned Bounding Box for triangle(s).
Definition at_math.h:48
Holds the material absorption and scattering coefficients.
Definition at.h:47
float absorption
Definition at.h:48
float scattering
Definition at.h:49
Groups the necessary information representing the 3D model.
Groups the scene config settings together.
Definition at.h:65
const AT_Model * environment
Definition at.h:71
AT_MaterialType material
Definition at.h:68
const AT_Source * sources
Definition at.h:66
uint32_t num_sources
Definition at.h:67
Groups the necessary information representing the scene.
The simulation's settings.
Definition at.h:77
uint32_t num_rays
Definition at.h:79
float voxel_size
Definition at.h:78
uint8_t fps
Definition at.h:80
Groups the necessary simulation data.
Groups the information required for the sound source.
Definition at.h:55
AT_Vec3 position
Definition at.h:56
AT_Vec3 direction
Definition at.h:57
float intensity
Definition at.h:58
Groups three floats to represent a vector of size 3.
Definition at_math.h:29