(0, 0, 0) because AkGeometry needs to be child of MeshInstance3D, with AkGeometry most likely having position (0, 0, 0) and MeshInstance3D and its parents having whatever random positions
When inspected in Wwise Game Object 3D Viewer the diffraction edges/shapes look ok, as the diffraction shapes are placed at the correct world position, just with the geometry_instance being at (0, 0, 0).
The problem is that when the game is tested, the diffraction and obstruction is not audible, especially when the AkGeometries are further away from global (0, 0, 0). The same can be seen in Wwise Game Object 3D Viewer while standing behind an AkGeometry. If I understand correctly https://github.com/alessandrofama/wwise-godot-integration/blob/main/addons/Wwise/native/src/scene/ak_geometry.cpp#L136 places the obstruction shape at the global (0, 0, 0) which then in its turn brakes also the computation of diffraction, even though the diffraction shape is in the "correct" world position.
This PR makes
The transform of geometry_instance to its global transform
The transform of vertices/triangles to be relative to AkGeometry's local (0, 0, 0)
This effectively makes both diffraction and obstruction shapes and path position themselves correctly, which can be inspected both in Wwise Game Object 3D Viewer and in game.
Thank you for creating this pull request and providing a testcase project (really!). I can reproduce the issue myself and this is clearly a bug! Thanks for the contribution.
The current code
When inspected in Wwise Game Object 3D Viewer the diffraction edges/shapes look ok, as the diffraction shapes are placed at the correct world position, just with the geometry_instance being at (0, 0, 0).
The problem is that when the game is tested, the diffraction and obstruction is not audible, especially when the AkGeometries are further away from global (0, 0, 0). The same can be seen in Wwise Game Object 3D Viewer while standing behind an AkGeometry. If I understand correctly https://github.com/alessandrofama/wwise-godot-integration/blob/main/addons/Wwise/native/src/scene/ak_geometry.cpp#L136 places the obstruction shape at the global (0, 0, 0) which then in its turn brakes also the computation of diffraction, even though the diffraction shape is in the "correct" world position.
This PR makes
This effectively makes both diffraction and obstruction shapes and path position themselves correctly, which can be inspected both in Wwise Game Object 3D Viewer and in game.
Testcase project https://github.com/artemkloko/wwise-godot-audio-test
🙇 Big thanks to the author and the contributors, this is 🔥