Carpenter Engine
A C++ game engine with a build once run anywhere solution
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Engine::Audio::Sound Class Reference

An Audio class that plays a multi-threaded impulse. More...

#include <Sound.hpp>

Inheritance diagram for Engine::Audio::Sound:
Engine::Audio::Audio

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.
 
- Public Member Functions inherited from Engine::Audio::Audio
 Audio (const char *filename)
 Default constructor.
 
void Play ()
 Plays the audio file.
 

Additional Inherited Members

- Protected Attributes inherited from Engine::Audio::Audio
const char * m_filename
 

Detailed Description

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.

Author
Roberto Selles

Member Function Documentation

◆ Play()

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

Parameters
{position}The distance in each axis from the camera

The documentation for this class was generated from the following files: