assaultcube / AC

AssaultCube
820 stars 212 forks source link

Listener orientation #483

Open ac-stef opened 4 months ago

ac-stef commented 4 months ago

Dropped in IRC from Quin. Dumping it here, so it doesn't get lost...

Hey, this is Quin from Red Eclipse Trying to find your versioning repository, but it doesn't seem obvious Are you guys still using SVN or something? I referenced AC's OpenAL implementation when implementing it in RE and I think I found a bug Ah GitHub, nvm OK, so this is incorrect, it results in the camera seeming to pan correctly, but it is actually upside down https://github.com/assaultcube/AC/blob/13f0d8eea4822dee5c976661218d022be74342e3/source/src/audiomanager.cpp#L677 You can verify this by creating a sound source and standing in front of it and turning around it will be louder when you're facing the wrong way Also the up vector is supposed to be the camera's up direction, orthogonal to the camera direction not just 0, 0, 1 Please feel free to reference my commit to RE and use the solution: https://github.com/redeclipse/base/commit/b5dc84d7434149d620e0a32b91b04c0cbc9e9fb7 just make sure the cam matrix has been setup correctly before updating sounds or calculate the vectors beforehand Anyway, have a great day guys, my work here is done :)

thx :)