alessandrofama / wwise-godot-integration

Wwise Integration for the Godot Engine
Other
288 stars 14 forks source link

Fixed ak_geometry transform setting in set_geometry #102

Closed artemkloko closed 1 month ago

artemkloko commented 1 month ago

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 🔥

alessandrofama commented 1 month ago

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.