AkReverbZone.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*******************************************************************************
  2. The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
  3. Technology released in source code form as part of the game integration package.
  4. The content of this file may not be used without valid licenses to the
  5. AUDIOKINETIC Wwise Technology.
  6. Note that the use of the game engine is subject to the Unreal(R) Engine End User
  7. License Agreement at https://www.unrealengine.com/en-US/eula/unreal
  8. License Usage
  9. Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
  10. this file in accordance with the end user license agreement provided with the
  11. software or, alternatively, in accordance with the terms contained
  12. in a written agreement between you and Audiokinetic Inc.
  13. Copyright (c) 2023 Audiokinetic Inc.
  14. *******************************************************************************/
  15. /*=============================================================================
  16. AkReverbZone.h:
  17. =============================================================================*/
  18. #pragma once
  19. #include "AkSpatialAudioVolume.h"
  20. #include "AkReverbZone.generated.h"
  21. /*------------------------------------------------------------------------------------
  22. AAkSpatialAudioVolume
  23. ------------------------------------------------------------------------------------*/
  24. UCLASS(ClassGroup = Audiokinetic, BlueprintType, hidecategories = (Advanced, Attachment, Volume))
  25. class AKAUDIO_API AAkReverbZone : public AAkSpatialAudioVolume
  26. {
  27. GENERATED_BODY()
  28. public:
  29. AAkReverbZone(const class FObjectInitializer& ObjectInitializer);
  30. /**
  31. * Establishes a parent-child relationship between two Rooms and allows for sound propagation between them
  32. * as if they were the same Room, without the need for a connecting Portal.
  33. * A parent Room may have multiple Reverb Zones, but a Reverb Zone can only have a single Parent.
  34. * The Reverb Zone and its parent are both Rooms, and as such, must be specified using Enable Room.
  35. * The automatically created 'outdoors' Room is commonly used as a parent Room for Reverb Zones, since they often model open spaces.
  36. * To attach a Reverb zone to outdoors, leave this property to None.
  37. */
  38. UPROPERTY(EditAnywhere, BlueprintSetter = UpdateParentSpatialAudioVolume, Category = "ReverbZone")
  39. AAkSpatialAudioVolume* ParentSpatialAudioVolume = nullptr;
  40. /** Set ParentSpatialAudioVolume with a new volume and notify updating the Reverb Zone in Wwise. */
  41. UFUNCTION(BlueprintSetter, Category = "ReverbZone")
  42. void UpdateParentSpatialAudioVolume(AAkSpatialAudioVolume* InParentSpatialAudioVolume);
  43. /**
  44. * Width of the transition region between the Reverb Zone and its parent.
  45. * The transition region is centered around the Reverb Zone geometry. It only applies where surface transmission loss is set to 0.
  46. * The value must be positive. Negative values are treated as 0.
  47. */
  48. UPROPERTY(EditAnywhere, BlueprintSetter = UpdateTransitionRegionWidth, Category = "ReverbZone")
  49. float TransitionRegionWidth = 0.f;
  50. /** Set TransitionRegionWidth with a new value and notify updating the Reverb Zone in Wwise. */
  51. UFUNCTION(BlueprintSetter, Category = "ReverbZone")
  52. void UpdateTransitionRegionWidth(float InTransitionRegionWidth);
  53. virtual void BeginPlay() override;
  54. virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
  55. virtual void Tick(float DeltaSeconds) override;
  56. #if WITH_EDITOR
  57. virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
  58. #endif
  59. private:
  60. void SetReverbZone();
  61. AkRoomID GetParentRoomID();
  62. bool bReverbZoneNeedsUpdate = false;
  63. };