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:
@@ -3,11 +3,13 @@
|
||||
#include <typeindex>
|
||||
#include <typeinfo>
|
||||
#include <imgui.h>
|
||||
#include "entity.h"
|
||||
|
||||
/**
|
||||
* namespace for the Entity-Component-System (ECS)
|
||||
*/
|
||||
namespace ecs {
|
||||
class Entity;
|
||||
|
||||
// Classe de base pour tous les composants
|
||||
class Component {
|
||||
@@ -31,6 +33,7 @@ public:
|
||||
/**
|
||||
* Virtual function to update the component.
|
||||
* @param deltaTime Time since the last update.
|
||||
* @param entity The entity this component is attached to.
|
||||
*/
|
||||
virtual void Update(float deltaTime) {}
|
||||
|
||||
@@ -52,6 +55,21 @@ public:
|
||||
* This can be overridden by derived components to provide custom UI.
|
||||
*/
|
||||
virtual void OnImGuiRender() { /* Default implementation does nothing */ }
|
||||
|
||||
/**
|
||||
* Set the parent entity of this component.
|
||||
* @param parent A shared pointer to the parent entity.
|
||||
*/
|
||||
void SetParent(std::shared_ptr<Entity> parent) { m_parent = parent; }
|
||||
|
||||
/**
|
||||
* Get the parent entity of this component.
|
||||
* @return A shared pointer to the parent entity, or nullptr if it has been destroyed.
|
||||
*/
|
||||
std::shared_ptr<Entity> GetParent() const { return m_parent.lock(); }
|
||||
|
||||
private:
|
||||
std::weak_ptr<Entity> m_parent;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user