Merge branch 'Gadgets/VisionLink' into MergingVisionLink
# Conflicts: # EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp
This commit is contained in:
commit
4a714ba3d7
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/BP_Ping.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/BP_Ping.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/PingImage.png
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/PingImage.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/PingImage.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/PingImage.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/WBP_Ping.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/WBP_Ping.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Viewport/VisionLinkViewPortBG.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Viewport/VisionLinkViewPortBG.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Viewport/WBP_VisionLinkViewPort.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Viewport/WBP_VisionLinkViewPort.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/VisionLinkViewPortBG.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/VisionLinkViewPortBG.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WBP_VisionLinkViewPort.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WBP_VisionLinkViewPort.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WBP_VisionLinkWatchFace.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WBP_VisionLinkWatchFace.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFace/WBP_VisionLinkWatchFace.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFace/WBP_VisionLinkWatchFace.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFace/WatchFaceBGImage.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFace/WatchFaceBGImage.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFaceBGImage.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFaceBGImage.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Audio/Collapse01.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Audio/Collapse01.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/UI/UI_Material_SeeThroughWalls.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/UI/UI_Material_SeeThroughWalls.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -3,6 +3,12 @@
|
||||
|
||||
#include "VisionLink.h"
|
||||
|
||||
#include "CollisionDebugDrawingPublic.h"
|
||||
#include "Kismet/KismetMathLibrary.h"
|
||||
#include "Camera/CameraComponent.h"
|
||||
#include "VisionLinkEnemyLOSTest.h"
|
||||
#include "GameFramework/Character.h"
|
||||
|
||||
void AVisionLink::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
@ -37,16 +43,45 @@ void AVisionLink::SendOutPingPulse()
|
||||
NumOfPingPulsesLeftInThisCycle--;
|
||||
UpdatePulsesRemaining(NumOfPingPulsesLeftInThisCycle);
|
||||
if (NumOfPingPulsesLeftInThisCycle < 0) return;
|
||||
|
||||
//FActorSpawnParameters SpawnParams;
|
||||
//SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
||||
//FVector SpawnLoc = (GetActorLocation() - EquippedOffset) + EnemyLOSTestActor.GetDefaultObject()->SpawnOffset;
|
||||
|
||||
//AActor* LOSTestActor = GetWorld()->SpawnActor<AActor>(EnemyLOSTestActor, SpawnLoc, GetActorRotation(), SpawnParams);
|
||||
//TArray<FString> EmptyFStringArray;
|
||||
//Cast<AVisionLinkEnemyLOSTest>(LOSTestActor)->TestLOS(EmptyFStringArray, GetOwner());
|
||||
|
||||
UE_LOG(LogTemp, Warning, TEXT("Ping Pulse!"));
|
||||
GetWorld()->GetTimerManager().SetTimer(PulseHandle, this, &AVisionLink::SendOutPingPulse, TimeInbetweenPingPulses, false);
|
||||
PlayPingPulseAnim(TimeInbetweenPingPulses);
|
||||
|
||||
UCameraComponent* PlayerCamComp = Cast<UCameraComponent>(GetWorld()->GetFirstPlayerController()->GetCharacter()->GetComponentByClass(UCameraComponent::StaticClass()));
|
||||
TArray<AActor*> ActorsToIgnore;
|
||||
ActorsToIgnore.Add(GetWorld()->GetFirstPlayerController()->GetCharacter());
|
||||
TestLOS(PlayerCamComp->GetComponentTransform(), ActorsToIgnore);
|
||||
}
|
||||
|
||||
void AVisionLink::TestLOS(FTransform StartingPos, TArray<AActor*> &ActorsToIgnore)
|
||||
{
|
||||
float H_DegreeIncrement = (float)H_FOV / (float)LT_Horizontal_Density;
|
||||
float V_DegreeIncrement = (float)V_FOV / (float)LT_Vertical_Density;
|
||||
float H_StartingRot = StartingPos.GetRotation().Rotator().Yaw - ((float)H_FOV / 2.0);
|
||||
float V_StartingRot = StartingPos.GetRotation().Rotator().Pitch - ((float)V_FOV / 2.0);
|
||||
|
||||
for (int H_Increment = 1; H_Increment <= LT_Horizontal_Density; H_Increment++)
|
||||
{
|
||||
for (int V_Increment = 1; V_Increment <= LT_Vertical_Density; V_Increment++)
|
||||
{
|
||||
FHitResult outHit;
|
||||
FCollisionQueryParams QueryParams = FCollisionQueryParams::DefaultQueryParam;
|
||||
QueryParams.bTraceComplex = true;
|
||||
QueryParams.AddIgnoredActors(ActorsToIgnore);
|
||||
|
||||
FRotator LT_Rot = FRotator(V_StartingRot + (V_Increment * V_DegreeIncrement), H_StartingRot + (H_Increment * H_DegreeIncrement), StartingPos.GetRotation().Rotator().Roll);
|
||||
FVector LT_EndPoint = StartingPos.GetLocation() + UKismetMathLibrary::GetForwardVector(LT_Rot) * LT_Distance;
|
||||
|
||||
if (!GetWorld()->LineTraceSingleByChannel(outHit, StartingPos.GetLocation(), LT_EndPoint, ECC_Camera, QueryParams)) continue;
|
||||
|
||||
AActor* HitActor = outHit.GetActor();
|
||||
if (!HitActor->ActorHasTag(FName("Enemy"))) continue;
|
||||
|
||||
//DrawDebugLine(GetWorld(), outHit.TraceStart, outHit.ImpactPoint, FColor::Blue, false, 3, 0, 3);
|
||||
ActorsToIgnore.Add(HitActor);
|
||||
SpawnPing(HitActor->GetTransform());
|
||||
TestLOS(HitActor->GetTransform(), ActorsToIgnore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,8 @@ class ENDLESSVENDETTA_API AVisionLink : public AReconGadget
|
||||
|
||||
void SendOutPingPulse();
|
||||
|
||||
void TestLOS(FTransform StartingPos, TArray<AActor*> &ActorsToIgnore);
|
||||
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
virtual void Activate() override;
|
||||
@ -34,7 +36,19 @@ protected:
|
||||
int NumberOfPingPulses = 1;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Vision Link")
|
||||
TSubclassOf<AVisionLinkEnemyLOSTest> EnemyLOSTestActor;
|
||||
int LT_Horizontal_Density = 80;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Vision Link")
|
||||
int LT_Vertical_Density = 25;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Vision Link")
|
||||
float LT_Distance = 4000;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Vision Link")
|
||||
float H_FOV = 75;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Vision Link")
|
||||
float V_FOV = 25;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Vision Link")
|
||||
float CooldownLength;
|
||||
@ -55,5 +69,7 @@ protected:
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Vision Link")
|
||||
void VisionLinkRecharging();
|
||||
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Vision Link")
|
||||
void SpawnPing(FTransform PingSpawnTransform);
|
||||
};
|
||||
|
@ -28,7 +28,7 @@ void AVisionLinkEnemyLOSTest::Tick(float DeltaTime)
|
||||
|
||||
}
|
||||
|
||||
void AVisionLinkEnemyLOSTest::TestLOS(TArray<FString> EnemiesInLink, AActor* LOSActor)
|
||||
void AVisionLinkEnemyLOSTest::TestLOS(TArray<uint32> EnemiesInLink, AActor* LOSActor)
|
||||
{
|
||||
// Get all overlapping Actors
|
||||
UBoxComponent* CollisionBox = Cast<UBoxComponent>(GetComponentByClass(UBoxComponent::StaticClass()));
|
||||
@ -47,9 +47,12 @@ void AVisionLinkEnemyLOSTest::TestLOS(TArray<FString> EnemiesInLink, AActor* LOS
|
||||
|
||||
for (int i = 0; i < OverlappingEnemies.Num(); i++)
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("Overlapping Enemy Name: %s"), *OverlappingEnemies[i]->GetName());
|
||||
// Overlapping Enemies Array should only contain enemies which aren't already in the link
|
||||
if (!OverlappingEnemies[i]->ActorHasTag(FName("Enemy")) || EnemiesInLink.Contains(OverlappingEnemies[i]->GetName())) OverlappingEnemies.RemoveAt(i);
|
||||
if (!OverlappingEnemies[i]->ActorHasTag(FName("Enemy")) || EnemiesInLink.Contains(OverlappingEnemies[i]->GetUniqueID()))
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("enemy name: %s"), *OverlappingEnemies[i]->GetName());
|
||||
OverlappingEnemies.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
if (OverlappingEnemies.IsEmpty())
|
||||
{
|
||||
@ -61,6 +64,7 @@ void AVisionLinkEnemyLOSTest::TestLOS(TArray<FString> EnemiesInLink, AActor* LOS
|
||||
{
|
||||
FRotator LookAtRotation = UKismetMathLibrary::FindLookAtRotation(LOSActor->GetActorLocation(), Enemy->GetActorLocation());
|
||||
UE_LOG(LogTemp, Warning, TEXT("Look at Rotation: %f"), LookAtRotation.Yaw);
|
||||
UE_LOG(LogTemp, Warning, TEXT("enemy name: %s"), *Enemy->GetName());
|
||||
}
|
||||
|
||||
Destroy();
|
||||
|
@ -18,7 +18,7 @@ protected:
|
||||
|
||||
public:
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Vision Link")
|
||||
FVector SpawnOffset = FVector(0, 0, 0 );
|
||||
float SpawnOffset = 0;
|
||||
|
||||
// Sets default values for this actor's properties
|
||||
AVisionLinkEnemyLOSTest();
|
||||
@ -26,5 +26,5 @@ public:
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
void TestLOS(TArray<FString> EnemiesInLink, AActor* LOS_Actor);
|
||||
void TestLOS(TArray<uint32> EnemiesInLink, AActor* LOS_Actor);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user