// Oleg Petruny proprietary.

#pragma once

#include "Components/SceneCaptureComponent2D.h"
#include "CoreMinimal.h"

#include "InteractableScreenCapturer.generated.h"

DECLARE_DELEGATE_OneParam(FInteractableInScreen, class AInteractable*);

UCLASS(hidecategories = (Collision, Object, Physics, SceneComponent), ClassGroup = Rendering, editinlinenew, meta = (BlueprintSpawnableComponent), MinimalAPI)
class UInteractableScreenCapturer : public USceneCaptureComponent2D
{
    GENERATED_BODY()

public:
    UInteractableScreenCapturer(const FObjectInitializer& ObjectInitializer);
    virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

    FInteractableInScreen interactableInScreenDelegate;

    UPROPERTY(EditAnywhere)
    float scanDistance = 7000;

protected:
    void Process();

private:
    FMinimalViewInfo _view;
    TSet<class AInteractable*> _sawInteractables;
    //class UTextureRenderTarget2D* _output;
};
