123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- #pragma once
- #include "GameFramework/Volume.h"
- #include "AkSurfaceReflectorSetComponent.h"
- #include "AkLateReverbComponent.h"
- #include "AkRoomComponent.h"
- #include "AkSpatialAudioVolume.generated.h"
- UENUM()
- enum class EAkFitToGeometryMode : uint32
- {
-
- OrientedBox,
-
-
- AlignedBox,
-
-
- ConvexPolyhedron
- };
- UCLASS(ClassGroup = Audiokinetic, BlueprintType, hidecategories = (Advanced, Attachment, Volume))
- class AKAUDIO_API AAkSpatialAudioVolume : public AVolume
- {
- GENERATED_BODY()
- public:
- AAkSpatialAudioVolume(const class FObjectInitializer& ObjectInitializer);
- #if WITH_EDITOR
- void FitRaycast();
- void FitBox(bool bPreviewOnly = false);
- bool bBrushNeedsRebuild = false;
- virtual bool ShouldTickIfViewportsOnly() const override;
- virtual void Tick(float DeltaSeconds) override;
- virtual void PostTransacted(const FTransactionObjectEvent& TransactionEvent) override;
- virtual void PostEditMove(bool bFinished) override;
- virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
- const TArray<FVector>& GetRaycastHits() const { return FitPoints; }
- float GetFitScale() const { return FilterHitPoints; }
- static const int kNumRaycasts = 32;
- virtual FName GetCustomIconName() const override
- {
- static const FName IconName("ClassIcon.AkSpatialAudioVolume");
- return IconName;
- }
- void PostRebuildBrush();
- void ClearTextComponents();
- void UpdatePreviewTextComponents(TArray<FVector> positions);
- void UpdatePreviewPolys(TArray<TMap<TWeakObjectPtr<UPhysicalMaterial>, int>> materialVotes);
- TArray<FAkSurfacePoly> PreviewPolys;
- #endif
- UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SpatialAudioVolume", meta = (ShowOnlyInnerProperties))
- UAkSurfaceReflectorSetComponent* SurfaceReflectorSet = nullptr;
- UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SpatialAudioVolume", meta = (ShowOnlyInnerProperties))
- UAkLateReverbComponent* LateReverb = nullptr;
- UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SpatialAudioVolume", meta = (ShowOnlyInnerProperties))
- UAkRoomComponent* Room = nullptr;
- #if WITH_EDITORONLY_DATA
-
- UPROPERTY(EditAnywhere, Category = "Fit to Geometry" )
- bool FitToGeometry = false;
-
- UPROPERTY(EditAnywhere, Category = "Fit to Geometry")
- TEnumAsByte<EAkCollisionChannel> CollisionChannel;
- #if WITH_EDITOR
-
- UFUNCTION(BlueprintCallable, Category = "Fit to Geometry")
- ECollisionChannel GetCollisionChannel();
- #endif
-
- UPROPERTY(EditAnywhere, Category = "Fit to Geometry" )
- EAkFitToGeometryMode Shape = EAkFitToGeometryMode::AlignedBox;
-
- UPROPERTY(EditAnywhere, Category = "Fit to Geometry", meta = (ClampMin = 0.1875f, ClampMax = 1.0f))
- float FilterHitPoints = 1.0f;
- UPROPERTY()
- TArray<FVector> FitPoints;
-
- UPROPERTY()
- TArray<FVector> FitNormals;
- UPROPERTY()
- TArray< TWeakObjectPtr<class UPhysicalMaterial> > FitMaterials;
-
- UPROPERTY()
- FRotator SavedRotation;
- TArray< TPair< FVector, FVector> > PreviewOutline;
- bool IsDragging = false;
- UPROPERTY()
- bool FitFailed = false;
-
- float LongestEdgeLength = 0.0f;
- mutable TArray<UTextRenderComponent*> PreviewTextureNameComponents;
- private:
- FBoxSphereBounds PreviousBounds = FBoxSphereBounds();
- #endif
- };
|