AkComponent.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  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. AkComponent.h:
  17. =============================================================================*/
  18. #pragma once
  19. #include "Runtime/Launch/Resources/Version.h"
  20. #include "AkInclude.h"
  21. #include "AkGameplayTypes.h"
  22. #include "AkSettings.h" // for EAkCollisionChannel
  23. #include "Components/SceneComponent.h"
  24. #include "ObstructionAndOcclusionService/AkComponentObstructionAndOcclusionService.h"
  25. #include "AkGameObject.h"
  26. #include "AkComponent.generated.h"
  27. UENUM(Meta = (Bitflags))
  28. enum class EReflectionFilterBits
  29. {
  30. Wall,
  31. Ceiling,
  32. Floor
  33. };
  34. // PostEvent functions need to return the PlayingID (uint32), but Blueprints only work with int32.
  35. // Make sure AkPlayingID is always 32 bits, or else we're gonna have a bad time.
  36. static_assert(sizeof(AkPlayingID) == sizeof(int32), "AkPlayingID is not 32 bits anymore. Change return value of PostEvent functions!");
  37. struct AkReverbFadeControl
  38. {
  39. public:
  40. uint32 AuxBusId;
  41. bool bIsFadingOut;
  42. void* FadeControlUniqueId;
  43. private:
  44. float CurrentControlValue;
  45. float TargetControlValue;
  46. float FadeRate;
  47. float Priority;
  48. public:
  49. AkReverbFadeControl(const class UAkLateReverbComponent& LateReverbComponent);
  50. void UpdateValues(const class UAkLateReverbComponent& LateReverbComponent);
  51. bool Update(float DeltaTime);
  52. void ForceCurrentToTargetValue() { CurrentControlValue = TargetControlValue; }
  53. AkAuxSendValue ToAkAuxSendValue() const;
  54. static bool Prioritize(const AkReverbFadeControl& A, const AkReverbFadeControl& B);
  55. };
  56. /*------------------------------------------------------------------------------------
  57. UAkComponent
  58. ------------------------------------------------------------------------------------*/
  59. UCLASS(ClassGroup=Audiokinetic, BlueprintType, Blueprintable, hidecategories=(Transform,Rendering,Mobility,LOD,Component,Activation), AutoExpandCategories=AkComponent, meta=(BlueprintSpawnableComponent))
  60. class AKAUDIO_API UAkComponent: public UAkGameObject
  61. {
  62. GENERATED_BODY()
  63. public:
  64. UAkComponent(const class FObjectInitializer& ObjectInitializer);
  65. UPROPERTY()
  66. bool bUseSpatialAudio_DEPRECATED = false;
  67. int32 ReflectionFilter_DEPRECATED;
  68. /**
  69. The line trace channel to use when doing line-of-sight traces for occlusion calculations. When set to 'Use Integration Settings Default', the value will be taken from the DefaultOcclusionCollisionChannel in the Wwise Integration Settings.
  70. */
  71. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AkComponent|Occlusion")
  72. TEnumAsByte<EAkCollisionChannel> OcclusionCollisionChannel = { EAkCollisionChannel::EAKCC_UseIntegrationSettingsDefault };
  73. UFUNCTION(BlueprintCallable, Category="AkComponent|Occlusion")
  74. ECollisionChannel GetOcclusionCollisionChannel();
  75. /**Enable spot reflectors for this Ak Component **/
  76. UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "AkComponent|Spatial Audio")
  77. bool EnableSpotReflectors = false;
  78. /**
  79. * Define an outer radius around each sound position to simulate a radial sound source.
  80. * If the listener is outside the outer radius, the spread is defined by the area that the sphere takes in the listener field of view.
  81. * When the listener intersects the outer radius, the spread is exactly 50%. When the listener is in between the inner and outer radius, the spread interpolates linearly from 50% to 100%.
  82. */
  83. UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "AkComponent|Spatial Audio|Radial Emitter", meta = (ClampMin = 0.0f) )
  84. float outerRadius = .0f;
  85. /**
  86. * Define an inner radius around each sound position to simulate a radial sound source.
  87. * If the listener is inside the inner radius, the spread is 100%.
  88. */
  89. UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "AkComponent|Spatial Audio|Radial Emitter", meta = (ClampMin = 0.0f))
  90. float innerRadius = .0f;
  91. UFUNCTION(BlueprintCallable, Category = "Audiokinetic|AkComponent")
  92. void SetGameObjectRadius(float in_outerRadius, float in_innerRadius);
  93. UFUNCTION(BlueprintCallable, Category = "Audiokinetic|AkComponent")
  94. void SetEnableSpotReflectors(bool in_enable);
  95. private:
  96. /**
  97. * Send to an Auxiliary Bus containing the Wwise Reflect plugin for early reflections rendering.
  98. * Note that the Wwise Auxiliary Bus for early reflections can also be set per-sound in the Sound Property Editor in the Wwise Authoring tool.
  99. * Setting a value here will apply only to sounds playing on the AK Component that do not have an Auxiliary Bus set in the Wwise Authoring tool.
  100. */
  101. UPROPERTY(EditAnywhere, Category = "AkComponent|Spatial Audio|Reflect")
  102. class UAkAuxBus * EarlyReflectionAuxBus = nullptr;
  103. /**
  104. * Send to an Auxiliary Bus containing the Wwise Reflect plugin for early reflections rendering.
  105. * Note that the Wwise Auxiliary Bus for early reflections can also be set per-sound in the Sound Property Editor in the Wwise Authoring tool.
  106. * Setting a value here will apply only to sounds playing on the AK Component that do not have an Auxiliary Bus set in the Wwise Authoring tool.
  107. */
  108. UPROPERTY(EditAnywhere, Category = "AkComponent|Spatial Audio|Reflect")
  109. FString EarlyReflectionAuxBusName;
  110. /** As of 2019.2, the Reflection Order is set in the Spatial Audio Initialization Settings in Project Settings */
  111. UPROPERTY(VisibleAnywhere, Category = "AkComponent|Spatial Audio|Reflect (DEPRECATED)", meta = (ClampMin = "0", ClampMax = "4"))
  112. int EarlyReflectionOrder = 0;
  113. /**
  114. * Set the send volume for the early reflections Auxiliary Bus.
  115. * The send volume applied to this AK Component will be applied additively to the Auxiliary Send volume defined per-sound in the Wwise Authoring tool.
  116. */
  117. UPROPERTY(EditAnywhere, Category = "AkComponent|Spatial Audio|Reflect", meta = (ClampMin = "0.0", ClampMax = "1.0"))
  118. float EarlyReflectionBusSendGain = .0f;
  119. /** As of 2019.2, the Reflection Max Path Length is set by the sound's Attenuation Max Distance value in the Authoring */
  120. UPROPERTY(VisibleAnywhere, Category = "AkComponent|Spatial Audio|Reflect (DEPRECATED)", meta = (ClampMin = "0.0"))
  121. float EarlyReflectionMaxPathLength = .0f;
  122. /** As of 2019.2, the Room Reverb Aux Bus Gain is set by the Game-Defined Auxiliary Sends Volume in the Sound Property Editor in the Authoring */
  123. UPROPERTY(VisibleAnywhere, Category = "AkComponent|Spatial Audio|Room (DEPRECATED)", meta = (ClampMin = "0.0", ClampMax = "1.0"))
  124. float roomReverbAuxBusGain = .0f;
  125. /** As of 2019.2, diffraction is enabled in the Sound Property Editor in the Authoring */
  126. UPROPERTY(VisibleAnywhere, Category = "AkComponent|Spatial Audio|Geometric Diffraction (DEPRECATED)", meta = (ClampMin = "0"))
  127. int diffractionMaxEdges = .0f;
  128. /** As of 2019.2, diffraction is enabled in the Sound Property Editor in the Authoring */
  129. UPROPERTY(VisibleAnywhere, Category = "AkComponent|Spatial Audio|Geometric Diffraction (DEPRECATED)", meta = (ClampMin = "0"))
  130. int diffractionMaxPaths = .0f;
  131. /** As of 2019.2, diffraction is enabled in the Sound Property Editor in the Authoring */
  132. UPROPERTY(VisibleAnywhere, Category = "AkComponent|Spatial Audio|Geometric Diffraction (DEPRECATED)", meta = (ClampMin = "0.0"))
  133. float diffractionMaxPathLength = .0f;
  134. public:
  135. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AkComponent|Spatial Audio|Debug Draw")
  136. bool DrawFirstOrderReflections = false;
  137. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AkComponent|Spatial Audio|Debug Draw")
  138. bool DrawSecondOrderReflections = false;
  139. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AkComponent|Spatial Audio|Debug Draw")
  140. bool DrawHigherOrderReflections = false;
  141. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AkComponent|Spatial Audio|Debug Draw")
  142. bool DrawDiffraction = false;
  143. /** Stop sound when owner is destroyed? */
  144. UPROPERTY()
  145. bool StopWhenOwnerDestroyed = false;
  146. /**
  147. * Posts this component's AkAudioEvent to Wwise, using this component as the game object source, and wait until the event is
  148. * done playing to continue execution. Extra calls while the event is playing are ignored.
  149. */
  150. UFUNCTION(BlueprintCallable, Category = "Audiokinetic|AkComponent", meta = (AdvancedDisplay = "0", Latent, LatentInfo = "LatentInfo"))
  151. int32 PostAssociatedAkEventAndWaitForEnd(FLatentActionInfo LatentInfo);
  152. /**
  153. * @warning This function is deprecated. Use \ref PostAssociatedAkEventAndWaitForEnd.
  154. * Async operations are deprecated.
  155. */
  156. UFUNCTION(BlueprintCallable, Category = "Audiokinetic|AkComponent", meta = (AdvancedDisplay = "1", Latent, LatentInfo = "LatentInfo", DeprecatedFunction, DeprecationMessage = "Use \"PostAssociatedAkEventAndWaitForEnd\"."))
  157. void PostAssociatedAkEventAndWaitForEndAsync(int32& PlayingID, FLatentActionInfo LatentInfo);
  158. /**
  159. * Posts an event to Wwise, using this component as the game object source, and wait until the event is
  160. * done playing to continue execution. Extra calls while the event is playing are ignored.
  161. *
  162. * @params in_EventName Deprecated: You should ensure AkEvent is valid.
  163. */
  164. UFUNCTION(BlueprintCallable, Category = "Audiokinetic|AkComponent", meta = (AdvancedDisplay = "1", Latent, LatentInfo = "LatentInfo"))
  165. int32 PostAkEventAndWaitForEnd(
  166. class UAkAudioEvent * AkEvent,
  167. const FString& in_EventName,
  168. FLatentActionInfo LatentInfo
  169. );
  170. /**
  171. * Posts an event to Wwise, using this component as the game object source, and wait until the event is
  172. * done playing to continue execution. Extra calls while the event is playing are ignored.
  173. *
  174. * @warning This function is deprecated. Use \ref PostAkEventAndWaitForEnd.
  175. * Async operations are deprecated.
  176. */
  177. UFUNCTION(BlueprintCallable, Category = "Audiokinetic|AkComponent", meta = (AdvancedDisplay = "2", Latent, LatentInfo = "LatentInfo", DeprecatedFunction, DeprecationMessage = "Use \"PostAkEventAndWaitForEnd\"."))
  178. void PostAkEventAndWaitForEndAsync(
  179. class UAkAudioEvent* AkEvent,
  180. int32& PlayingID,
  181. FLatentActionInfo LatentInfo
  182. );
  183. int32 PostAkEvent(UAkAudioEvent* AkEvent, int32 CallbackMask, const FOnAkPostEventCallback& PostEventCallback, const FString& InEventName) override;
  184. AkPlayingID PostAkEvent(UAkAudioEvent* AkEvent, AkUInt32 Flags = 0, AkCallbackFunc UserCallback = nullptr, void* UserCookie = nullptr) override;
  185. /**
  186. * @warning Using EventName in this function is deprecated. Use \ref PostAkEvent.
  187. */
  188. AK_DEPRECATED(2022.1, "Use PostAkEvent.")
  189. AkPlayingID PostAkEventByNameWithDelegate(UAkAudioEvent* AkEvent, const FString& in_EventName, int32 CallbackMask, const FOnAkPostEventCallback& PostEventCallback) override;
  190. /**
  191. * @warning This function is deprecated. You are expected to use an UAkAudioEvent. Use \ref PostAkEvent.
  192. */
  193. AK_DEPRECATED(2022.1, "Use PostAkEvent.")
  194. AkPlayingID PostAkEventByIdWithCallback(const AkUInt32 EventShortID, AkUInt32 Flags = 0, AkCallbackFunc UserCallback = NULL, void * UserCookie = NULL, const TArray<AkExternalSourceInfo>& ExternalSources = TArray<AkExternalSourceInfo>());
  195. /**
  196. * Posts a trigger to wwise, using this component as the game object source
  197. *
  198. * @param Trigger The name of the trigger
  199. */
  200. UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category="Audiokinetic|AkComponent", meta = (AdvancedDisplay = "1"))
  201. void PostTrigger(class UAkTrigger const* TriggerValue, FString Trigger);
  202. /**
  203. * Sets a switch group in wwise, using this component as the game object source
  204. *
  205. * @param SwitchGroup The name of the switch group
  206. * @param SwitchState The new state of the switch
  207. */
  208. UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category="Audiokinetic|AkComponent", meta = (AdvancedDisplay = "1"))
  209. void SetSwitch(class UAkSwitchValue const* SwitchValue, FString SwitchGroup, FString SwitchState);
  210. /**
  211. * Sets whether or not to stop sounds when the component's owner is destroyed
  212. *
  213. * @param bStopWhenOwnerDestroyed Whether or not to stop sounds when the component's owner is destroyed
  214. */
  215. UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category="Audiokinetic|AkComponent")
  216. void SetStopWhenOwnerDestroyed( bool bStopWhenOwnerDestroyed );
  217. /**
  218. * Set a game object's listeners
  219. *
  220. * @param Listeners The array of components that listen to this component
  221. */
  222. UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category="Audiokinetic|AkComponent")
  223. void SetListeners( const TArray<UAkComponent*>& Listeners );
  224. // Reverb volumes functions
  225. /**
  226. * Set UseReverbVolumes flag. Set value to true to use reverb volumes on this component.
  227. *
  228. * @param inUseReverbVolumes Whether to use reverb volumes or not.
  229. */
  230. UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category="Audiokinetic|AkComponent", meta = (DeprecatedFunction, DeprecationMessage = "Use the \"UseReverbVolume\" property", ScriptName="DEPRECATED_UseReverbVolumes"))
  231. void UseReverbVolumes(bool inUseReverbVolumes);
  232. UFUNCTION(BlueprintCallable, Category = "Audiokinetic|AkComponent", meta = (AdvancedDisplay = "5", DeprecatedFunction, DeprecationMessage = "This function is deprecated and will be removed in future releases."))
  233. void UseEarlyReflections(class UAkAuxBus* AuxBus, int Order = 1, float BusSendGain = 1.f, float MaxPathLength = 100000.f, bool SpotReflectors = false, const FString& AuxBusName = FString(""));
  234. /**
  235. * Set the early reflections aux bus for this AK Component.
  236. * Geometrical reflection calculation inside spatial audio is enabled for a game object if any sound playing on the game object has a valid early reflections aux bus specified in the authoring tool,
  237. * or if an aux bus is specified via SetEarlyReflectionsAuxSend.
  238. * The AuxBusName parameter of SetEarlyReflectionsAuxSend applies to sounds playing on the Wwise game object which have not specified an early reflection bus in the authoring tool -
  239. * the parameter specified on individual sounds' reflection bus takes priority over the value passed in to SetEarlyReflectionsAuxSend.
  240. * @param AuxBusName - Name of aux bus in the Wwise project.
  241. */
  242. UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Audiokinetic|AkComponent")
  243. void SetEarlyReflectionsAuxBus(const FString& AuxBusName);
  244. /**
  245. * Set the early reflections volume for this AK Component. The SendVolume parameter is used to control the volume of the early reflections send. It is combined with the early reflections volume specified in the authoring tool,
  246. * and is applied to all sounds playing on the Wwise game object.
  247. * @param SendVolume - Send volume to the early reflections aux bus.
  248. */
  249. UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Audiokinetic|AkComponent")
  250. void SetEarlyReflectionsVolume(float SendVolume);
  251. /**
  252. * Set the output bus volume (direct) to be used for the specified game object.
  253. * The control value is a number ranging from 0.0f to 1.0f.
  254. *
  255. * @param BusVolume - Bus volume to set
  256. */
  257. UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Audiokinetic|AkComponent")
  258. void SetOutputBusVolume(float BusVolume);
  259. /** Modifies the attenuation computations on this game object to simulate sounds with a a larger or smaller area of effect. */
  260. UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="AkComponent")
  261. float AttenuationScalingFactor = .0f;
  262. /** Sets the attenuation scaling factor, which modifies the attenuation computations on this game object to simulate sounds with a a larger or smaller area of effect. */
  263. UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Audiokinetic|AkComponent")
  264. void SetAttenuationScalingFactor(float Value);
  265. /** Set the time interval between occlusion/obstruction checks (direct line of sight between the listener and this game object). Set to 0 to disable occlusion/obstruction on this component. We recommend disabling it if you want to use full Spatial Audio diffraction. */
  266. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AkComponent|Occlusion")
  267. float OcclusionRefreshInterval = .0f;
  268. /** Whether to use reverb volumes or not */
  269. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AkComponent")
  270. bool bUseReverbVolumes = true;
  271. /**
  272. * Return the real attenuation radius for this component (AttenuationScalingFactor * AkAudioEvent->MaxAttenuationRadius)
  273. */
  274. UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category="Audiokinetic|AkComponent")
  275. float GetAttenuationRadius() const;
  276. void UpdateGameObjectPosition();
  277. void GetAkGameObjectName(FString& Name) const;
  278. bool IsDefaultListener = false;
  279. #if CPP
  280. /*------------------------------------------------------------------------------------
  281. UActorComponent interface.
  282. ------------------------------------------------------------------------------------*/
  283. /**
  284. * Called after component is registered
  285. */
  286. virtual void OnRegister();
  287. /**
  288. * Called after component is unregistered
  289. */
  290. virtual void OnUnregister();
  291. /**
  292. * Clean up
  293. */
  294. virtual void OnComponentDestroyed(bool bDestroyingHierarchy) override;
  295. /**
  296. * Clean up after error
  297. */
  298. virtual void ShutdownAfterError();
  299. virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;
  300. // Begin USceneComponent Interface
  301. virtual void BeginPlay() override;
  302. virtual void OnUpdateTransform(EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport = ETeleportType::None) override;
  303. // End USceneComponent Interface
  304. /** Gets all AkLateReverbComponents at the AkComponent's current location, and puts them in a list
  305. *
  306. * @param Loc The location of the AkComponent
  307. */
  308. void UpdateAkLateReverbComponentList(FVector Loc);
  309. /** Gets the current room the AkComponent is in.
  310. *
  311. * @param Location The location of the AkComponent
  312. */
  313. void UpdateSpatialAudioRoom(FVector Location);
  314. void SetAutoDestroy(bool in_AutoDestroy) { bAutoDestroy = in_AutoDestroy; }
  315. bool UseDefaultListeners() const { return bUseDefaultListeners; }
  316. void OnListenerUnregistered(UAkComponent* in_pListener)
  317. {
  318. Listeners.Remove(in_pListener);
  319. }
  320. void OnDefaultListenerAdded(UAkComponent* in_pListener)
  321. {
  322. check(bUseDefaultListeners);
  323. Listeners.Add(in_pListener);
  324. }
  325. const TSet<UAkComponent*>& GetEmitters();
  326. static UAkComponent* GetAkComponent(AkGameObjectID GameObjectID);
  327. AkRoomID GetSpatialAudioRoom() const;
  328. void UpdateObstructionAndOcclusion() { ObstructionService.UpdateObstructionAndOcclusion(Listeners, GetPosition(), GetOwner(), GetSpatialAudioRoom(), GetOcclusionCollisionChannel(), OcclusionRefreshInterval); }
  329. FVector GetPosition() const;
  330. #if WITH_EDITOR
  331. virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
  332. #endif
  333. private:
  334. /**
  335. * Register the component with Wwise
  336. */
  337. void RegisterGameObject();
  338. /**
  339. * Unregister the component from Wwise
  340. */
  341. void UnregisterGameObject();
  342. /*
  343. * Called after registering the component with Wwise
  344. */
  345. virtual void PostRegisterGameObject();
  346. /*
  347. * Called after unregistering the component from Wwise
  348. */
  349. virtual void PostUnregisterGameObject();
  350. // Reverb Volume features ---------------------------------------------------------------------
  351. /** Apply the current list of AkReverbVolumes
  352. *
  353. * @param DeltaTime The given time increment since last fade computation
  354. */
  355. void ApplyAkReverbVolumeList(float DeltaTime);
  356. AkComponentObstructionAndOcclusionService ObstructionService;
  357. /** Array of the active AkReverbVolumes at the AkComponent's location */
  358. TArray<AkReverbFadeControl> ReverbFadeControls;
  359. /** Aux Send values sent to the SoundEngine in the previous frame */
  360. TArray<AkAuxSendValue> CurrentAuxSendValues;
  361. /** Do we need to refresh Aux Send values? */
  362. bool NeedToUpdateAuxSends(const TArray<AkAuxSendValue>& NewValues);
  363. /** Room the AkComponent is currently in. nullptr if none */
  364. class UAkRoomComponent* CurrentRoom;
  365. /** Whether to automatically destroy the component when the event is finished */
  366. bool bAutoDestroy;
  367. /** Previous known position. Used to avoid Spamming SetPOsition on a listener */
  368. AkSoundPosition CurrentSoundPosition;
  369. bool HasMoved();
  370. #endif
  371. #if WITH_EDITORONLY_DATA
  372. /** Utility function that updates which texture is displayed on the sprite dependent on the properties of the Audio Component. */
  373. void UpdateSpriteTexture();
  374. #endif
  375. bool bUseDefaultListeners;
  376. TSet<UAkComponent*> Listeners;
  377. //NOTE: This set of emitters is only valid if this UAkComopnent is a listener, and it it is not a default listener. See GetEmitters().
  378. TSet<UAkComponent*> Emitters;
  379. void CheckEmitterListenerConsistancy();
  380. void DebugDrawReflections() const;
  381. void _DebugDrawReflections(const AkVector64& akEmitterPos, const AkVector64& akListenerPos, const AkReflectionPathInfo* paths, AkUInt32 uNumPaths) const;
  382. void DebugDrawDiffraction() const;
  383. void _DebugDrawDiffraction(const AkVector64& akEmitterPos, const AkVector64& akListenerPos, const AkDiffractionPathInfo* paths, AkUInt32 uNumPaths) const;
  384. };