Minor - Adds audio component with spatialization - V13.3.0
Adds a new audio component with support for loading, playing, pausing, stopping, and controlling audio properties such as volume, pan, pitch, and looping. Implements spatialization using FMOD, enabling 3D audio effects based on object and camera positions. Includes file selection dialog and UI controls for audio properties.
This commit is contained in:
@@ -6,13 +6,15 @@
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
#include "camera_class.h"
|
||||
|
||||
namespace ecs {
|
||||
/**
|
||||
* Type alias for a unique identifier for an entity.
|
||||
*/
|
||||
using EntityID = uint32_t;
|
||||
|
||||
class Entity {
|
||||
class Entity : public std::enable_shared_from_this<Entity> {
|
||||
public:
|
||||
/**
|
||||
* Builder for an Entity with a unique ID.
|
||||
@@ -59,6 +61,9 @@ public:
|
||||
// Cr<43>er et ajouter le composant
|
||||
auto component = std::make_shared<T>(std::forward<Args>(args)...);
|
||||
m_Components[typeID] = component;
|
||||
|
||||
component->SetParent(shared_from_this());
|
||||
|
||||
|
||||
// Initialiser le composant
|
||||
component->Initialize();
|
||||
@@ -132,6 +137,9 @@ public:
|
||||
return m_Components;
|
||||
}
|
||||
|
||||
void SetCamera(camera_class* camera) {m_camera = camera; }
|
||||
camera_class* GetCamera() const { return m_camera; }
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
@@ -143,6 +151,9 @@ private:
|
||||
* The key is the type ID of the component, and the value is a shared pointer to the component.
|
||||
*/
|
||||
std::unordered_map<ComponentTypeID, ComponentPtr> m_Components;
|
||||
|
||||
// camera
|
||||
camera_class* m_camera = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ecs
|
||||
|
||||
Reference in New Issue
Block a user