33 #ifndef _NSOUND_MESH_2D_H_
34 #define _NSOUND_MESH_2D_H_
101 const std::string & dirname =
".",
102 const std::string & prefix =
"mesh");
Mesh2D(const float64 &sample_rate, uint32 width, uint32 height, const float64 &leak_gain, const float64 &tau, const float64 &delta=6.0, const float64 &gamma=8.0)
Constructor.
float64 getEnergy() const
Calculate total energy in the mesh.
Buffer strike(const Buffer &x_pos, const Buffer &y_pos, const Buffer &velocity)
Hit the mesh many times at different locations.
float64 gamma_
MeshJunction delta.
void clear()
Clears all MeshJunctions to zero.
void setMeshDumping(boolean flag, const std::string &dirname=".", const std::string &prefix="mesh")
Enables the dumping of mesh values to disk for use with mesh2blender.py.
void allocMemory()
Allocates memory for the mesh.
void writeMeshMap()
Write to disk the mesh map, used with mesh2blender.py.
void freeMemory()
Frees memory from the mesh.
uint32 Y_
The number of MeshJunctions columns.
Mesh2D & operator=(const Mesh2D &rhs)
Assignment operator.
float64 tau_
MeshJunction leak gain.
boolean dump_mesh_
Center MeshJunction where final sound is collected.
MeshJunction * center_
Array of pointers.
float64 leak_gain_
The number of MeshJunctions rows.
void writeMeshFile(const std::string &mode)
MeshJunction ** mesh_
MeshJunction gamma.
float64 delta_
MeshJunction tau.
A Buffer for storing audio samples.
MeshJunction * mesh(uint32 x, uint32 y)
float64 tick(const float64 &x_pos, const float64 &y_pos, const float64 &velocity)
Calculate one sample.