Update to the (now GPL) AeonWave version 3.0+
This commit is contained in:
parent
84b636debc
commit
c03359a189
@ -10,12 +10,13 @@
|
|||||||
#
|
#
|
||||||
# Created by Erik Hofman.
|
# Created by Erik Hofman.
|
||||||
|
|
||||||
FIND_PATH(AAX_INCLUDE_DIR aax/aeonwave.hpp
|
FIND_PATH(AAX_INCLUDE_DIR aax/aax.h
|
||||||
HINTS
|
HINTS
|
||||||
$ENV{AAXDIR}
|
$ENV{AAXDIR}
|
||||||
$ENV{ProgramFiles}/aax
|
$ENV{ProgramFiles}/aax
|
||||||
$ENV{ProgramFiles}/AeonWave
|
$ENV{ProgramFiles}/AeonWave
|
||||||
$ENV{ProgramFiles}/Adalin/AeonWave
|
$ENV{ProgramFiles}/Adalin/AeonWave
|
||||||
|
${CMAKE_SOURCE_DIR}/aax
|
||||||
PATH_SUFFIXES include
|
PATH_SUFFIXES include
|
||||||
PATHS
|
PATHS
|
||||||
~/Library/Frameworks
|
~/Library/Frameworks
|
||||||
@ -26,23 +27,35 @@ FIND_PATH(AAX_INCLUDE_DIR aax/aeonwave.hpp
|
|||||||
)
|
)
|
||||||
|
|
||||||
FIND_LIBRARY(AAX_LIBRARY
|
FIND_LIBRARY(AAX_LIBRARY
|
||||||
NAMES AAX aax AAX32 libAAX32
|
NAMES AAX aax AAX32
|
||||||
HINTS
|
HINTS
|
||||||
$ENV{AAXDIR}
|
$ENV{AAXDIR}
|
||||||
$ENV{ProgramFiles}/AAX
|
$ENV{ProgramFiles}/AAX
|
||||||
$ENV{ProgramFiles}/AeonWave
|
$ENV{ProgramFiles}/AeonWave
|
||||||
$ENV{ProgramFiles}/Adalin/AeonWave
|
$ENV{ProgramFiles}/Adalin/AeonWave
|
||||||
|
${CMAKE_BUILD_DIR}/aax
|
||||||
PATH_SUFFIXES bin lib lib/${CMAKE_LIBRARY_ARCHITECTURE} lib64 libs64 libs libs/Win32 libs/Win64
|
PATH_SUFFIXES bin lib lib/${CMAKE_LIBRARY_ARCHITECTURE} lib64 libs64 libs libs/Win32 libs/Win64
|
||||||
PATHS
|
PATHS
|
||||||
~/Library/Frameworks
|
~/Library/Frameworks
|
||||||
/Library/Frameworks
|
/Library/Frameworks
|
||||||
|
/usr/local
|
||||||
/usr
|
/usr
|
||||||
/opt
|
/opt
|
||||||
/usr/local
|
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(AAX_FOUND "NO")
|
|
||||||
IF(AAX_LIBRARY AND AAX_INCLUDE_DIR)
|
IF(AAX_LIBRARY AND AAX_INCLUDE_DIR)
|
||||||
SET(AAX_FOUND "YES")
|
SET(AAX_FOUND "YES")
|
||||||
|
ELSE(AAX_LIBRARY AND AAX_INCLUDE_DIR)
|
||||||
|
IF(NOT AAX_INCLUDE_DIR)
|
||||||
|
MESSAGE(FATAL_ERROR "Unable to find the AAX library development files.")
|
||||||
|
SET(AAX_FOUND "NO")
|
||||||
|
ENDIF(NOT AAX_INCLUDE_DIR)
|
||||||
|
IF(NOT AAX_LIBRARY)
|
||||||
|
IF(SINGLE_PACKAGE)
|
||||||
|
SET(AAX_LIBRARY "${aax_BUILD_DIR}/aax/AAX32.dll")
|
||||||
|
SET(AAX_FOUND "YES")
|
||||||
|
ELSE(SINGLE_PACKAGE)
|
||||||
|
ENDIF(SINGLE_PACKAGE)
|
||||||
|
ENDIF(NOT AAX_LIBRARY)
|
||||||
ENDIF(AAX_LIBRARY AND AAX_INCLUDE_DIR)
|
ENDIF(AAX_LIBRARY AND AAX_INCLUDE_DIR)
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ find_dependency(Threads)
|
|||||||
|
|
||||||
set(SIMGEAR_HEADLESS @SIMGEAR_HEADLESS@)
|
set(SIMGEAR_HEADLESS @SIMGEAR_HEADLESS@)
|
||||||
set(SIMGEAR_SOUND @ENABLE_SOUND@)
|
set(SIMGEAR_SOUND @ENABLE_SOUND@)
|
||||||
|
set(USE_AEONWAVE @USE_AEONWAVE@)
|
||||||
|
|
||||||
# OpenAL isn't a public dependency, so maybe not needed
|
# OpenAL isn't a public dependency, so maybe not needed
|
||||||
#if (SIMGEAR_SOUND)
|
#if (SIMGEAR_SOUND)
|
||||||
|
@ -4,16 +4,15 @@ set(HEADERS
|
|||||||
sample.hxx
|
sample.hxx
|
||||||
sample_group.hxx
|
sample_group.hxx
|
||||||
xmlsound.hxx
|
xmlsound.hxx
|
||||||
readwav.hxx
|
|
||||||
soundmgr.hxx
|
soundmgr.hxx
|
||||||
|
filters.hxx
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
sample.cxx
|
sample.cxx
|
||||||
sample_group.cxx
|
sample_group.cxx
|
||||||
xmlsound.cxx
|
xmlsound.cxx
|
||||||
readwav.cxx
|
filters.cxx
|
||||||
soundmgr_openal_private.hxx
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (USE_AEONWAVE)
|
if (USE_AEONWAVE)
|
||||||
@ -21,8 +20,13 @@ if (USE_AEONWAVE)
|
|||||||
soundmgr_aeonwave.cxx
|
soundmgr_aeonwave.cxx
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
|
set(HEADERS ${HEADERS}
|
||||||
|
readwav.hxx
|
||||||
|
)
|
||||||
set(SOURCES ${SOURCES}
|
set(SOURCES ${SOURCES}
|
||||||
soundmgr_openal.cxx
|
soundmgr_openal.cxx
|
||||||
|
soundmgr_openal_private.hxx
|
||||||
|
readwav.cxx
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -66,15 +66,15 @@ int main( int argc, char *argv[] )
|
|||||||
std::cout << "Vendor: " << _vendor << std::endl;
|
std::cout << "Vendor: " << _vendor << std::endl;
|
||||||
std::cout << "Renderer: " << _renderer << std::endl;
|
std::cout << "Renderer: " << _renderer << std::endl;
|
||||||
|
|
||||||
aax::Matrix64 mtx64;
|
aax::Matrix mtx;
|
||||||
mtx64.translate(-5000.0, 12500.0, 1000.0);
|
mtx.translate(-5000.0, 12500.0, 1000.0);
|
||||||
|
|
||||||
aax::Matrix mtx = mtx64.toMatrix();
|
aax::Matrix64 mtx64 = mtx.toMatrix64();
|
||||||
emitter.matrix(mtx);
|
emitter.matrix(mtx64);
|
||||||
|
|
||||||
mtx.translate(-5.0, 2.0, 1.0);
|
mtx.translate(-5.0, 2.0, 1.0);
|
||||||
mtx.inverse();
|
mtx64.inverse();
|
||||||
aax.sensor_matrix(mtx);
|
aax.sensor_matrix(mtx64);
|
||||||
|
|
||||||
aax.set(AAX_PLAYING);
|
aax.set(AAX_PLAYING);
|
||||||
emitter.set(AAX_PLAYING);
|
emitter.set(AAX_PLAYING);
|
||||||
|
@ -92,14 +92,14 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init() {
|
void init() {
|
||||||
_mtx = aax::Matrix();
|
_mtx = aax::Matrix64();
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_pos_and_orientation()
|
void update_pos_and_orientation()
|
||||||
{
|
{
|
||||||
SGVec3d sgv_at = _orientation.backTransform(-SGVec3d::e3());
|
SGVec3d sgv_at = _orientation.backTransform(-SGVec3d::e3());
|
||||||
SGVec3d sgv_up = _orientation.backTransform(SGVec3d::e2());
|
SGVec3d sgv_up = _orientation.backTransform(SGVec3d::e2());
|
||||||
SGVec3f pos = SGVec3f::zeros();
|
SGVec3d pos = SGVec3d::zeros();
|
||||||
|
|
||||||
_mtx.set(pos.data(), toVec3f(sgv_at).data(), toVec3f(sgv_up).data());
|
_mtx.set(pos.data(), toVec3f(sgv_at).data(), toVec3f(sgv_up).data());
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
aax::AeonWave _aax;
|
aax::AeonWave _aax;
|
||||||
aax::Matrix _mtx;
|
aax::Matrix64 _mtx;
|
||||||
|
|
||||||
SGVec3d _absolute_pos;
|
SGVec3d _absolute_pos;
|
||||||
SGVec3d _base_pos;
|
SGVec3d _base_pos;
|
||||||
@ -338,7 +338,7 @@ void SGSoundMgr::update( double dt )
|
|||||||
TRY( dsp.set(AAX_SOUND_VELOCITY, 340.3f) );
|
TRY( dsp.set(AAX_SOUND_VELOCITY, 340.3f) );
|
||||||
TRY( d->_aax.set(dsp) );
|
TRY( d->_aax.set(dsp) );
|
||||||
#endif
|
#endif
|
||||||
aax::Matrix mtx = d->_mtx;
|
aax::Matrix64 mtx = d->_mtx;
|
||||||
mtx.inverse();
|
mtx.inverse();
|
||||||
TRY( d->_aax.sensor_matrix(mtx) );
|
TRY( d->_aax.sensor_matrix(mtx) );
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ unsigned int SGSoundMgr::request_buffer(SGSoundSample *sample)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bufid = d->_buffer_id++;
|
bufid = d->_buffer_id++;
|
||||||
d->_buffers.insert( std::make_pair<unsigned int,aax::Buffer&>(bufid,buf) );
|
d->_buffers.insert( {bufid, buf} );
|
||||||
|
|
||||||
if ( !sample->is_file() ) {
|
if ( !sample->is_file() ) {
|
||||||
enum aaxFormat format = AAX_FORMAT_NONE;
|
enum aaxFormat format = AAX_FORMAT_NONE;
|
||||||
@ -493,7 +493,7 @@ unsigned int SGSoundMgr::request_buffer(SGSoundSample *sample)
|
|||||||
unsigned int no_samples = sample->get_no_samples();
|
unsigned int no_samples = sample->get_no_samples();
|
||||||
unsigned int no_tracks = sample->get_no_tracks();
|
unsigned int no_tracks = sample->get_no_tracks();
|
||||||
unsigned int frequency = sample->get_frequency();
|
unsigned int frequency = sample->get_frequency();
|
||||||
TRY( buf.set(d->_aax, no_samples, no_tracks, format) );
|
buf.set(d->_aax, no_samples, no_tracks, format);
|
||||||
TRY( buf.set(AAX_FREQUENCY, frequency) );
|
TRY( buf.set(AAX_FREQUENCY, frequency) );
|
||||||
TRY( buf.fill(sample->get_data()) );
|
TRY( buf.fill(sample->get_data()) );
|
||||||
|
|
||||||
@ -659,11 +659,11 @@ void SGSoundMgr::update_sample_config( SGSoundSample *sample, SGVec3d& position,
|
|||||||
aax::Emitter& emitter = d->get_emitter(sample->get_source());
|
aax::Emitter& emitter = d->get_emitter(sample->get_source());
|
||||||
aax::dsp dsp;
|
aax::dsp dsp;
|
||||||
|
|
||||||
aax::Vector pos = toVec3f(position).data();
|
aax::Vector64 pos = position.data();
|
||||||
aax::Vector ori = orientation.data();
|
aax::Vector ori = orientation.data();
|
||||||
aax::Vector vel = velocity.data();
|
aax::Vector vel = velocity.data();
|
||||||
|
|
||||||
aax::Matrix mtx(pos, ori);
|
aax::Matrix64 mtx(pos, ori);
|
||||||
TRY( emitter.matrix(mtx) );
|
TRY( emitter.matrix(mtx) );
|
||||||
TRY( emitter.velocity(vel) );
|
TRY( emitter.velocity(vel) );
|
||||||
|
|
||||||
@ -763,7 +763,8 @@ void SGSoundMgr::set_position( const SGVec3d& pos, const SGGeod& pos_geod )
|
|||||||
|
|
||||||
SGVec3f SGSoundMgr::get_direction() const
|
SGVec3f SGSoundMgr::get_direction() const
|
||||||
{
|
{
|
||||||
aaxVec3f pos, at, up;
|
aaxVec3f at, up;
|
||||||
|
aaxVec3d pos;
|
||||||
d->_mtx.get(pos, at, up);
|
d->_mtx.get(pos, at, up);
|
||||||
return SGVec3f( at );
|
return SGVec3f( at );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user