velocity = sample->get_velocity();
}
+ if (_smgr->bad_doppler_effect()) {
+ velocity *= 100.0f;
+ }
+
#if 0
if (length(position) > 20000)
printf("%s source and listener distance greater than 20km!\n",
_geod_pos(SGGeod::fromCart(SGVec3d::zeros())),
_velocity(SGVec3d::zeros()),
_orientation(SGQuatd::zeros()),
- _devname(NULL)
+ _devname(NULL),
+ _bad_doppler(false)
{
#if defined(ALUT_API_MAJOR_VERSION) && ALUT_API_MAJOR_VERSION >= 1
if (_alut_init == 0) {
else break;
}
+ const char *renderer = (char *)alGetString(AL_RENDERER);
+ if ( strcmp(renderer, "OpenAL Sample Implementation") ) {
+ _bad_doppler = true;
+ }
+
if (_free_sources.size() == 0) {
SG_LOG(SG_GENERAL, SG_ALERT, "Unable to grab any OpenAL sources!");
}
*/
inline bool has_changed() { return _changed; }
+ /**
+ * Some implementations seem to need the velocity miltyplied by a
+ * factor of 100 to make them distinct. I've not found if this is
+ * a problem in the implementation or in out code. Until then
+ * this function is used to detect the problematic implementations.
+ */
+ inline bool bad_doppler_effect() { return _bad_doppler; }
+
/**
* Load a sample file and return it's configuration and data.
* @param samplepath Path to the file to load
vector<ALuint> _sources_in_use;
char *_devname;
+ bool _bad_doppler;
bool testForALError(string s);
bool testForALCError(string s);