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:
2025-09-15 23:15:34 +02:00
parent 5ee88ff932
commit aa8e5d2abd
9 changed files with 479 additions and 35 deletions

View File

@@ -82,6 +82,36 @@ public:
*/
void get_reflection_view_matrix(XMMATRIX&) const;
XMFLOAT3 get_forward() const {
float pitch = XMConvertToRadians(rotation_x_);
float yaw = XMConvertToRadians(rotation_y_);
XMMATRIX rotMatrix = XMMatrixRotationRollPitchYaw(pitch, yaw, 0.0f);
XMVECTOR forward = -rotMatrix.r[2];
forward = XMVector3Normalize(forward);
XMFLOAT3 forwardVec;
XMStoreFloat3(&forwardVec, forward);
return forwardVec;
}
XMFLOAT3 get_up() const {
// Construire matrice rotation <20> partir des angles
XMMATRIX rot = XMMatrixRotationRollPitchYaw(
XMConvertToRadians(rotation_x_),
XMConvertToRadians(rotation_y_),
XMConvertToRadians(rotation_z_));
// Extraire le vecteur up, 2e colonne
XMVECTOR up = rot.r[1]; // colonne up
up = XMVector3Normalize(up);
XMFLOAT3 upF;
XMStoreFloat3(&upF, up);
return upF;
}
private:
float position_x_, position_y_, position_z_;
float rotation_x_, rotation_y_, rotation_z_;