LEAP Documentation 40220
Documentation for the LEAP project
DeployableControlledDrone.h
Go to the documentation of this file.
1// Copyright Blue Isle Studios Inc 2018. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "DeployableControlledDrone.generated.h"
8
9class UStaticMeshComponent;
10
11UCLASS()
13{
14 GENERATED_UCLASS_BODY()
15
16public:
17 virtual void DeployComplete() override;
18 virtual void Died(float Damage, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser, APlayerState* InstigatorPlayerState) override;
19 virtual void OnOwnerDied() override;
20 virtual void MoveDeployableForward(float Value) override;
21 virtual void MoveDeployableRight(float Value) override;
22 virtual void MoveDeployableUp(float Value) override;
23 virtual bool CanOwningWeaponInstanceFire() const { return true; }
24
25protected:
26 virtual void UpdateDeployableTransform(float DeltaTime) override;
27
28 UFUNCTION(BlueprintImplementableEvent, Category = "Drone|Explosion")
29 void K2_PlayExplosionEffects(const FVector& ExplosionLocation);
30 UFUNCTION(BlueprintImplementableEvent, Category = "Drone")
31 void K2_OnPitchRotation(const float PitchValue);
32 UFUNCTION(BlueprintImplementableEvent, Category = "Drone")
33 void K2_OnYawRotation(const float YawValue);
34 UFUNCTION(BlueprintPure, Category = "Drone")
35 FORCEINLINE FVector GetAcceleration() const { return Acceleration; }
36
37protected:
38 /* Launch velocity of the drone (relative to the camera) */
39 UPROPERTY(EditDefaultsOnly, Category = "Drone|Movement")
40 FVector LaunchVelocity = FVector(100, 0, 0);
41 /* The rate in which we use to apply a "breaking force"to the yaw rotation */
42 UPROPERTY(EditDefaultsOnly, Category = "Drone|Movement|Rotation")
43 float YawBreakingRate = 1.f;
44 /* The rate in which we use to lerp our Pitch */
45 UPROPERTY(EditDefaultsOnly, Category = "Drone|Movement|Rotation")
46 float PitchAccelerationRate = 1.f;
47 /* The min/max rate in which we can accelerate our yaw rotation */
48 UPROPERTY(EditDefaultsOnly, Category = "Drone|Movement|Rotation")
49 FVector2D MinMaxYawRotationAcceleration = FVector2D(-2.f, 2.f);
50 /* How fast does our mesh interpolate our position to the target one */
51 UPROPERTY(EditDefaultsOnly, Category = "Drone|Movement")
52 float LocationInterpolationSpeed = 2.f;
53 /* How fast does our mesh interpolate our rotation to the target one */
54 UPROPERTY(EditDefaultsOnly, Category = "Drone|Movement")
55 float RotationInterpolationSpeed = 2.f;
56 /* Speed increment to be applied when applying input to control the drone */
57 UPROPERTY(EditDefaultsOnly, Category = "Drone|Movement")
58 float DroneAcceleration = 100.f;
59
60 UFUNCTION(NetMulticast, Unreliable)
61 virtual void Multicast_Explosion_PlayExplosionEffects_Unreliable(const FVector& ExplosionLocation);
62 virtual void Server_MoveDeployable_Unreliable_Implementation(EDeployableMovementDirection Acceleration) override;
63
64private:
65 FVector PreviousDroneLocation = FVector::ZeroVector;
66 FRotator PreviousDroneRotation = FRotator::ZeroRotator;
67 FVector2D RotationAcceleration = FVector2D::ZeroVector;
68 FVector Acceleration = FVector::ZeroVector;
69};
EDeployableMovementDirection
Definition: DeployableControllable.h:17
Definition: DeployableControllable.h:30
Definition: DeployableControlledDrone.h:13
virtual bool CanOwningWeaponInstanceFire() const
Definition: DeployableControlledDrone.h:23