afritz1 / OpenTESArena

Open-source re-implementation of The Elder Scrolls: Arena.
MIT License
988 stars 68 forks source link

Implementation of 3d positional audio #170

Closed Plettro closed 4 years ago

Plettro commented 4 years ago

I implemented a simple 3d audio system that satisfies the requests stated in issue #166 . Here are the changes:

This is my first time using git(hub), so I apologize in advance if I messed up something.

Also, sorry for all of the unnecessary space removals, it was my editor's fault and I don't really know how to reverse them...

Let me know if you want me to change anything or if you think my approach could be improved :)

afritz1 commented 4 years ago

Thank you. It's cool to finally have doors playing 3D sounds 🎉

This PR is pretty much what I was looking for. It's smaller than the other active ones so I should be able to merge it fairly easily. Will just go through and make some small revisions and experiment with a ListenerData struct passed to AudioManager::update() instead of setting listener position/orientation directly.

I'll probably also add an option to choose between 2D and 3D world sounds because some people might prefer the authentic (mildly bad) Arena experience where they can't tell where a fireball is coming from.

afritz1 commented 4 years ago

Seems ready to merge into master, thanks again.