123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #pragma once
- #include "AkGameplayTypes.h"
- #include "AkReverbDescriptor.generated.h"
- class UAkAcousticTextureSetComponent;
- class UAkLateReverbComponent;
- class UAkRoomComponent;
- #define PARAM_ESTIMATION_UPDATE_PERIOD 0.1f
- USTRUCT()
- struct AKAUDIO_API FAkReverbDescriptor
- {
- GENERATED_BODY()
- public:
- static double TriangleArea(const FVector& v1, const FVector& v2, const FVector& v3);
- static float SignedVolumeOfTriangle(const FVector& p1, const FVector& p2, const FVector& p3);
- float PrimitiveVolume = 0.0f;
- float PrimitiveSurfaceArea = 0.0f;
- float T60Decay = 0.0f;
- float HFDamping = 0.0f;
- float TimeToFirstReflection = 0.0f;
-
- bool ShouldEstimateDecay() const;
- bool ShouldEstimateDamping() const;
- bool ShouldEstimatePredelay() const;
- bool RequiresUpdates() const;
- void CalculateT60(UAkLateReverbComponent* reverbComp);
- void CalculateTimeToFirstReflection();
- void CalculateHFDamping(const UAkAcousticTextureSetComponent* textureSetComponent);
-
- void SetPrimitive(UPrimitiveComponent* primitive);
- void SetReverbComponent(UAkLateReverbComponent* reverbComp);
- void UpdateAllRTPCs(const UAkRoomComponent* room) const;
- private:
- UPROPERTY(Transient)
- UPrimitiveComponent* Primitive = nullptr;
- UAkLateReverbComponent* ReverbComponent = nullptr;
-
- bool GetRTPCRoom(UAkRoomComponent*& room) const;
- bool CanSetRTPCOnRoom(const UAkRoomComponent* room) const;
- void UpdateDecayRTPC() const;
- void UpdateDampingRTPC() const;
- void UpdatePredelaytRTPC() const;
- };
|