Agrarsense
OverlapSensorParameters.h
Go to the documentation of this file.
1// Copyright (c) 2023 FrostBit Software Lab at the Lapland University of Applied Sciences
2//
3// This work is licensed under the terms of the MIT license.
4// For a copy, see <https://opensource.org/licenses/MIT>.
5
6#pragma once
7
8#include "GameFramework/Actor.h"
9
10#include "OverlapSensorParameters.generated.h"
11
12UENUM(BlueprintType)
13enum class ETriggerShape : uint8
14{
15 Sphere = 0 UMETA(DisplayName = "Sphere"),
16 Box = 1 UMETA(DisplayName = "Box")
17};
18
19USTRUCT(Blueprintable)
20struct AGRARSENSE_API FOverlapSensorParameters
21{
22 GENERATED_BODY()
23
24 UPROPERTY(EditAnywhere, BlueprintReadWrite)
25 AActor* OwningActor = nullptr;
26
27 UPROPERTY(EditAnywhere, BlueprintReadWrite)
28 FTransform Transform;
29
30 UPROPERTY(EditAnywhere, BlueprintReadWrite)
31 FVector RelativePosition = FVector(0.0f, 0.0f, 0.0f);
32
33 UPROPERTY(EditAnywhere, BlueprintReadWrite)
34 ETriggerShape TriggerShape = ETriggerShape::Sphere;
35
36 UPROPERTY(EditAnywhere, BlueprintReadWrite)
37 FVector Size = FVector(1.0f, 1.0f, 1.0f);
38
39 UPROPERTY(EditAnywhere, BlueprintReadWrite)
40 bool CreateROSTopic = true;
41
42 FString ToHumanReadable(const FTransform& TransformToLog) const
43 {
44 auto T = TransformToLog.GetTranslation();
45 auto R = TransformToLog.GetRotation();
46 auto S = TransformToLog.GetScale3D();
47
48 FString Output = FString::Printf(TEXT("Translation: %f %f %f\n"), T.X, T.Y, T.Z);
49 Output.Appendf(TEXT("Rotation: X %f Y %f Z %f\n"), R.X, R.Y, R.Z);
50 Output.Appendf(TEXT("Scale3D: %f %f %f"), S.X, S.Y, S.Z);
51
52 return Output;
53 }
54};