76 lines
2.2 KiB
C++
76 lines
2.2 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Camera/CameraActor.h"
|
|
#include "GameFramework/Pawn.h"
|
|
#include "Components/SceneCaptureComponent2D.h"
|
|
#include "Engine/TextureRenderTarget2D.h"
|
|
#include "GameFramework/SpringArmComponent.h"
|
|
#include "LuckySensorPawnBase.generated.h"
|
|
|
|
USTRUCT(BlueprintType)
|
|
struct FSensorInfo
|
|
{
|
|
GENERATED_USTRUCT_BODY()
|
|
|
|
public:
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="Sensor")
|
|
FString Name = FString();
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="Sensor")
|
|
FVector Anchor = FVector::ZeroVector;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="Sensor")
|
|
float Distance = 0.f;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="Sensor")
|
|
FRotator Rotation = FRotator::ZeroRotator;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="Sensor")
|
|
bool bActive = false;
|
|
};
|
|
|
|
UCLASS()
|
|
class LUCKYDATATRANSFER_API ALuckySensorPawnBase : public APawn
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
// Sets default values for this pawn's properties
|
|
ALuckySensorPawnBase();
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="Sensor")
|
|
FSensorInfo SensorInfo = FSensorInfo();
|
|
|
|
UFUNCTION(BlueprintCallable, Category="Sensor")
|
|
UCameraComponent* GetCamera() const { return Camera; }
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="Sensor")
|
|
UTextureRenderTarget2D* RenderTarget = nullptr;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="Sensor")
|
|
USceneCaptureComponent2D* CaptureComponent = nullptr;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="Sensor")
|
|
USpringArmComponent* SpringArm = nullptr;
|
|
|
|
UFUNCTION(BlueprintCallable, Category="Sensor")
|
|
USceneCaptureComponent2D* GetCaptureComponent() const { return CaptureComponent; }
|
|
|
|
protected:
|
|
// Called when the game starts or when spawned
|
|
virtual void BeginPlay() override;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="Sensor")
|
|
UCameraComponent* Camera = nullptr;
|
|
|
|
public:
|
|
// Called every frame
|
|
virtual void Tick(float DeltaTime) override;
|
|
|
|
// Called to bind functionality to input
|
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
|
};
|