From a458de88b65c5fcb0f11c005c040163d3cf76cec Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Mon, 15 Aug 2011 21:50:09 +0000 Subject: 3D Audio GSoC: High quality resampling on mixdown, linear for playback. * Lots of improvements and fixes for the JOS resampler, now it works fine! * High quality filter coefficients for the JOS resampler (sorry for the 5 MB source file). * Fix for GE orientation bug. Note: moto uses x,y,z,w quaternion storage, while rest of blender uses w,x,y,z. * Minor changes/fixes. --- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 6 +++--- source/gameengine/Ketsji/KX_SoundActuator.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source/gameengine/Ketsji') diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 0b83e3247ff..a51105e0c16 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -1016,15 +1016,15 @@ void KX_KetsjiEngine::DoSound(KX_Scene* scene) if(dev) { AUD_Vector3 v; - AUD_Quaternion q; + float q[4]; cam->NodeGetWorldPosition().getValue(v.get()); dev->setListenerLocation(v); cam->GetLinearVelocity().getValue(v.get()); dev->setListenerVelocity(v); - cam->NodeGetWorldOrientation().getRotation().getValue(q.get()); - dev->setListenerOrientation(q); + cam->NodeGetWorldOrientation().getRotation().getValue(q); + dev->setListenerOrientation(AUD_Quaternion(q[3], q[0], q[1], q[2])); } } diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index eb1a13f672d..eb75e4944a7 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -224,14 +224,14 @@ bool KX_SoundActuator::Update(double curtime, bool frame) { KX_GameObject* obj = (KX_GameObject*)this->GetParent(); AUD_Vector3 v; - AUD_Quaternion q; + float q[4]; obj->NodeGetWorldPosition().getValue(v.get()); handle3d->setSourceLocation(v); obj->GetLinearVelocity().getValue(v.get()); handle3d->setSourceVelocity(v); - obj->NodeGetWorldOrientation().getRotation().getValue(q.get()); - handle3d->setSourceOrientation(q); + obj->NodeGetWorldOrientation().getRotation().getValue(q); + handle3d->setSourceOrientation(AUD_Quaternion(q[3], q[0], q[1], q[2])); } result = true; } -- cgit v1.2.3