12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #pragma once
- #include "AkInclude.h"
- #include "AkSettings.h"
- #include "AkAcousticTexture.h"
- #include "Components/SceneComponent.h"
- #include "AkAcousticTextureSetComponent.generated.h"
- struct FAkReverbDescriptor;
- UCLASS(ClassGroup = Audiokinetic, abstract)
- class AKAUDIO_API UAkAcousticTextureSetComponent : public USceneComponent
- {
- GENERATED_BODY()
- public:
- UAkAcousticTextureSetComponent(const class FObjectInitializer& ObjectInitializer);
- virtual void GetTexturesAndSurfaceAreas(TArray<FAkAcousticTextureParams>& textures, TArray<float>& surfaceAreas) const { check(0 && "This function must be overidden"); }
- void SetReverbDescriptor(FAkReverbDescriptor* reverbDescriptor);
- virtual void OnRegister() override;
- virtual void OnUnregister() override;
- virtual void BeginPlay() override;
- virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
- virtual AkGeometrySetID GetGeometrySetID() const { return AkGeometrySetID(this); }
- virtual bool GetGeometryHasBeenSent() const { return GeometryHasBeenSent; }
- virtual bool GetGeometryInstanceHasBeenSent() const { return GeometryInstanceHasBeenSent; }
- protected:
- void RecalculateHFDamping();
- #if WITH_EDITOR
- virtual void BeginDestroy() override;
- virtual void HandleObjectsReplaced(const TMap<UObject*, UObject*>& ReplacementMap);
- void RegisterReverbRTPCChangedCallback();
- FDelegateHandle RTPCChangedHandle;
- virtual void RegisterAllTextureParamCallbacks() { check(0 && "This function must be overidden"); }
- void RegisterTextureParamChangeCallback(FGuid textureID);
- void UnregisterTextureParamChangeCallbacks();
-
- TMap<FGuid, FDelegateHandle> TextureDelegateHandles;
- #endif
- FAkReverbDescriptor* ReverbDescriptor = nullptr;
- bool DampingEstimationNeedsUpdate = false;
- virtual bool ShouldSendGeometry() const;
-
- void SendGeometryToWwise(const AkGeometryParams& params);
-
- void SendGeometryInstanceToWwise(const FRotator& rotation, const FVector& location, const FVector& scale, const AkRoomID roomID, bool useForReflectionAndDiffraction);
-
- void RemoveGeometryFromWwise();
-
- void RemoveGeometryInstanceFromWwise();
- private:
- #if WITH_EDITOR
- virtual bool ContainsTexture(const FGuid& textureID)
- {
- check(0 && "This function must be overidden");
- return false;
- }
- #endif
- float SecondsSinceDampingUpdate = 0.0f;
- bool GeometryHasBeenSent = false;
- bool GeometryInstanceHasBeenSent = false;
- };
|