Space Plunder
Loading...
Searching...
No Matches
SecurityCameraPawn.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
8#include "SecurityCameraPawn.generated.h"
9
10class USpotLightComponent;
11class UCameraComponent;
19UCLASS()
20class AITOOLKIT_API ASecurityCameraPawn : public ADefenseSystemPawn, public IPhysicsPickup
21{
22 GENERATED_BODY()
23
24public:
26
27 UFUNCTION(BlueprintImplementableEvent, Category="Security Camera")
28 void OnSnappedToObject(const bool bValue);
29
30
31protected:
32 virtual void BeginPlay() override;
33 virtual void GetActorEyesViewPoint(FVector& OutLocation, FRotator& OutRotation) const override;
34 virtual bool GetIsUpsideDown() const override;
35
36 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "Security Camera|Visual")
37 UStaticMeshComponent* BaseMeshComponent;
38 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "Security Camera|Visual")
39 UStaticMeshComponent* HeadMeshComponent;
40 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "Security Camera|Visual")
41 UCameraComponent* CameraComponent;
42 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "Security Camera|Visual")
43 USpotLightComponent* SpotLightComponent;
44 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "Security Camera|Visual")
45 USceneCaptureComponent2D* SceneCaptureComponent;
46 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "Security Camera|Visual")
47 USceneComponent* SnapTargets;
48
49 virtual void TargetSeen(APawn* Pawn) override;
50
51 virtual void EnemySeen() override;
52 virtual void LostAllTargets() override;
53 virtual void RotateToTarget() override;
54
55 UFUNCTION(BlueprintCallable, Category="Security Camera")
56 void RotateCamera();
57
58 virtual void OnDeath(AActor* OwningActor, EDeathType DeathType, AActor* DeathCauser, AController* DeathInstigator) override;
59
60 virtual UPrimitiveComponent* GetGrabComponent() const override;
61
62 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
63 //~~ Physics Pickup ~~//
64 virtual FPhysicsPickupData GetPhysicsPickupData() const override {return PhysicsPickupData;};
65 virtual bool GetIsSnapped() const override{return bSnapped;};
66
67 virtual void SetSnapped(const bool bValue) override;
68 virtual TArray<UArrowComponent*> GetSnapComponents() override;
69 //~~ Physics Pickup ~~//
70 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
71 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Security Camera|Physics")
72 FPhysicsPickupData PhysicsPickupData;
73 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Security Camera|Physics")
74 bool bSnapped = false;
75
76 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Security Camera|Rotation")
77 float CameraRotateFrequency = 0.1f;
78 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Security Camera|Rotation")
79 float CameraRotateToTargetFrequency = 0.1f;
80
81 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Security Camera|Rotation")
82 float CameraMaxRotation = 90.0f;
84 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Security Camera|Rotation")
85 float CameraTargetRotationTolerance = 10.0f;
87 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Security Camera|Rotation")
88 float VisibilityPercentNeeded = 60.0f;
89 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Security Camera|Rotation")
90 float RotationOffset = -90.0f;
91
92
93private:
94
95 void RotateBackToStart();
96
97
98 bool bChangeDirection = false;
99
100 float LerpAlpha = 0.0f;
101
102 FRotator StartRelativeRotation = FRotator::ZeroRotator;
103
104 FTimerHandle RotateTimerHandle;
105 FTimerHandle RotateToTargetTimerHandle;
106
107 FTimerHandle RotateBackToStartTimerHandle;
108
109};
EDeathType
Definition BaseData.h:53
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Represents a defense system pawn that can interact with other actors and participate in the generic t...
Definition DefenseSystemPawn.h:28
Represents a security camera pawn in the game.
Definition SecurityCameraPawn.h:21
virtual bool GetIsSnapped() const override
Definition SecurityCameraPawn.h:65
Definition PhysicsPickup.h:21
Definition InteractionData.h:73