Carpenter Engine
A C++ game engine with a build once run anywhere solution
|
An Audio class that plays a multi-threaded impulse. More...
#include <Sound.hpp>
Public Member Functions | |
Sound (const char *filename) | |
Default constructor. | |
void | Play () |
Plays the sound normally. | |
void | Play (Vec3f position) |
Plays the sound relative to where the camera position is to the object. | |
![]() | |
Audio (const char *filename) | |
Default constructor. | |
void | Play () |
Plays the audio file. | |
Additional Inherited Members | |
![]() | |
const char * | m_filename |
An Audio class that plays a multi-threaded impulse.
When needed, this class will play the sound in a separate thread allowing the sound to be played multiple times while the main code is running.
void Engine::Audio::Sound::Play | ( | Vec3f | position | ) |
Plays the sound relative to where the camera position is to the object.
The position is the distance from the camera. When you determine the position of the sound, you should assume the following computation:
Sound Position = Global Position - Camera Global Position
{position} | The distance in each axis from the camera |