Space Plunder
Loading...
Searching...
No Matches
AShipTurret Class Reference

#include <ShipTurret.h>

Inheritance diagram for AShipTurret:
AInteractablePawn IBaseInterface ISaveLoad

Public Member Functions

 AShipTurret ()
 
- Public Member Functions inherited from AInteractablePawn
 AInteractablePawn ()
 
virtual void ReceiveStartFocus (AActor *Caller)
 
virtual void ReceiveEndFocus (AActor *Caller)
 
virtual void ReceiveOnInteract (AActor *Caller, const EInteractionType InteractionType)
 
virtual void ReceiveOnEndInteract (AActor *Caller)
 
virtual void ReceiveOnOverlap (AActor *Caller)
 
virtual void ReceiveOnEndOverlap (AActor *Caller)
 
virtual void ReceiveToggleSwitch (AActor *Caller, const bool bOn)
 
virtual void InteractionDataUpdated ()
 
virtual void SetupPlayerInputComponent (class UInputComponent *PlayerInputComponent) override
 

Protected Member Functions

virtual void BeginPlay () override
 
void RotateTurret (const FVector &Target)
 
- Protected Member Functions inherited from AInteractablePawn
virtual bool SaveGame () override
 
virtual bool LoadGame () override
 
FVector GetCustomInteractionLocation () const
 
void LogDebugError (const FString &Message) const
 
void LogDebugError (const FString &Message, const int32 Value) const
 
void LogDebugError (const FString &Message, const float Value) const
 
void LogDebugWarning (const FString &Message) const
 
void LogDebugWarning (const FString &Message, const int32 Value) const
 
void LogDebugWarning (const FString &Message, const float Value) const
 
void LogDebugMessage (const FString &Message, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const int32 Value, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const float Value, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const bool bValue, const bool bWarning, const bool bError) const
 
void LogOnScreenMessage (const int32 Key, const FString &Message, FColor Color=FColor::Green) const
 
void SetCategoryName (const FLogCategoryBase &Category)
 

Protected Attributes

UCapsuleComponent * CapsuleComponent
 
USkeletalMeshComponent * SkeletalMeshComponent
 
UHealthComponentBase * HealthComponent
 
USpringArmComponent * SpringArm
 
UCameraComponent * Camera
 
int32 NumberOfBarrels = 1
 
- Protected Attributes inherited from AInteractablePawn
class UAudioReactionComponent * AudioReactionComponent
 
class UInteractableActorComponent * InteractableActorComponent
 
class UAIPerceptionStimuliSourceComponent * PerceptionStimuliComponent
 
bool bDebuggingMode = false
 

Private Member Functions

void Death (AActor *OwningActor, EDeathType DeathType, AActor *DeathCauser, AController *DeathInstigator)
 

Constructor & Destructor Documentation

◆ AShipTurret()

AShipTurret::AShipTurret ( )
11{
12 CapsuleComponent = CreateDefaultSubobject<UCapsuleComponent>(TEXT("Capsule"));
13 RootComponent = CapsuleComponent;
14
15 SkeletalMeshComponent = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Skeletal Mesh"));
18 if(SkeletalMeshComponent->DoesSocketExist("Barrel_Socket_R") || SkeletalMeshComponent->DoesSocketExist("Barrel_Socket_L"))
19 {
21 }
22 if(SkeletalMeshComponent->DoesSocketExist("Barrel_Socket_R") && SkeletalMeshComponent->DoesSocketExist("Barrel_Socket_L"))
23 {
25 }
26
27 HealthComponent = CreateDefaultSubobject<UHealthComponentBase>(TEXT("Health"));
28
29 SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("Spring Arm"));
30 SpringArm->SetupAttachment(SkeletalMeshComponent, FName("TP_CameraTrace"));
31
32 Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
33 Camera->SetupAttachment(SpringArm);
34
35}
USkeletalMeshComponent * SkeletalMeshComponent
Definition ShipTurret.h:34
UCapsuleComponent * CapsuleComponent
Definition ShipTurret.h:32
USpringArmComponent * SpringArm
Definition ShipTurret.h:38
int32 NumberOfBarrels
Definition ShipTurret.h:43
UHealthComponentBase * HealthComponent
Definition ShipTurret.h:36
UCameraComponent * Camera
Definition ShipTurret.h:40

Member Function Documentation

◆ BeginPlay()

void AShipTurret::BeginPlay ( )
overrideprotectedvirtual

Reimplemented from AInteractablePawn.

38{
39 Super::BeginPlay();
40 if(HealthComponent != nullptr)
41 {
42 HealthComponent->OnDeath.AddUniqueDynamic(this, &AShipTurret::Death);
43 }
44}
void Death(AActor *OwningActor, EDeathType DeathType, AActor *DeathCauser, AController *DeathInstigator)
Definition ShipTurret.cpp:54

◆ Death()

void AShipTurret::Death ( AActor * OwningActor,
EDeathType DeathType,
AActor * DeathCauser,
AController * DeathInstigator )
private
55{
56
57}

◆ RotateTurret()

void AShipTurret::RotateTurret ( const FVector & Target)
protected
47{
48 // FVector LookAtTargetClean = FVector(Target.X, Target.Y, SkeletalMeshComponent->GetComponentLocation().Z);
49 // FVector StartLocation = SkeletalMeshComponent->GetComponentLocation();
50 // FRotator TurretRotation = FVector(FVector(LookAtTargetClean - StartLocation)).Rotation();
51 // SkeletalMeshComponent->SetWorldRotation(TurretRotation);
52}

Member Data Documentation

◆ Camera

UCameraComponent* AShipTurret::Camera
protected

◆ CapsuleComponent

UCapsuleComponent* AShipTurret::CapsuleComponent
protected

◆ HealthComponent

UHealthComponentBase* AShipTurret::HealthComponent
protected

◆ NumberOfBarrels

int32 AShipTurret::NumberOfBarrels = 1
protected

◆ SkeletalMeshComponent

USkeletalMeshComponent* AShipTurret::SkeletalMeshComponent
protected

◆ SpringArm

USpringArmComponent* AShipTurret::SpringArm
protected

The documentation for this class was generated from the following files: