DeskSim v2 0.1
Train simulator prototype created for Lokførerskolen
Drone.h
1// Copyright 2022 Thomas Arinesalingam, John Ole Bjerke, Endre Heksum & Henrik Markengbakken Karlsen . All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "GameFramework/Pawn.h"
7#include "Camera/CameraComponent.h"
8#include "Train.h"
9#include <DeskSimV2/SaveGame/IsSaveableInterface.h>
10#include "Drone.generated.h"
11
12
13UCLASS()
14class DESKSIMV2_API ADrone : public APawn, public IIsSaveableInterface
15{
16 GENERATED_BODY()
17
18public:
19 // Sets default values for this pawn's properties
20 ADrone();
21
22protected:
23 // Called when the game starts or when spawned
24 virtual void BeginPlay() override;
25
26public:
27 // Called every frame
28 virtual void Tick(float DeltaTime) override;
29
30 // Called to bind functionality to input
31 virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
32
33 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = UCameraComponent)
34 UCameraComponent* DroneCamera;
35
36 bool bIsJustPossessed;
37 bool bStartPositionSet;
38
39 // Called to controll the drone movement.
40 void MoveForward(float AxisValue);
41 void MoveStrafe(float AxisValue);
42 void MovePitch(float AxisValue);
43 void MoveYaw(float AxisValue);
44
45 void SwitchToTrain();
46
47private:
48 ATrain* TrainActor;
49 FVector CurrentForward;
50 FVector CurrentStrafe;
51 FVector2D CurrentRotation;
52
53 const float MAXSPEED = 10000.0f;
54
55};
56
Definition: Drone.h:15
Definition: Train.h:17
Definition: IsSaveableInterface.h:20