diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/BP_Ping.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/BP_Ping.uasset new file mode 100644 index 00000000..4b2eeb98 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/BP_Ping.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d550ef5403fa8eb4429aa8a02bf20ee8861165cdfec6f86783634750e14c7ad2 +size 64620 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/PingImage.png b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/PingImage.png new file mode 100644 index 00000000..6e12b0fe --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/PingImage.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e0e7b01c20546d33776b7e9ab7b48c2e81a79c07558f92ed0ef035ad729cd2a +size 66320 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/PingImage.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/PingImage.uasset new file mode 100644 index 00000000..9f97a970 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/PingImage.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d64b09bc01c01afde43af7565f5c136c6dff1330b0db17d871964513366fc5ad +size 74632 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/WBP_Ping.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/WBP_Ping.uasset new file mode 100644 index 00000000..18281d37 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Ping/WBP_Ping.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11ba552af3b2c39dcfae07749f63f56e4f87b1bcc38306d9a7f51d037e20e5d5 +size 54205 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset index a98e94f1..a52acef6 100644 --- a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2a063d83c2d3461bee076adc8e95f993662e0d2cfe542ea8adfec6b524ecde24 -size 97920 +oid sha256:00ef54778dd4058c75ad6dca1b46531f8b20b3b154373294be43fa8d5e9ebbdc +size 106247 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/VisionLinkViewPortBG.png b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Viewport/VisionLinkViewPortBG.png similarity index 100% rename from EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/VisionLinkViewPortBG.png rename to EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Viewport/VisionLinkViewPortBG.png diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Viewport/VisionLinkViewPortBG.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Viewport/VisionLinkViewPortBG.uasset new file mode 100644 index 00000000..8db47e99 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Viewport/VisionLinkViewPortBG.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67d9f11bc227f55da0c8ed5642e838600c464ad28dd6ff960cf8d89e3e4d2156 +size 45631 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Viewport/WBP_VisionLinkViewPort.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Viewport/WBP_VisionLinkViewPort.uasset new file mode 100644 index 00000000..2fe7eeaa --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/Viewport/WBP_VisionLinkViewPort.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0df7d8ccd875abeaaa1f439439dc1a8dd8fb765c09cbaf506743dcfede51538 +size 199275 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/VisionLinkViewPortBG.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/VisionLinkViewPortBG.uasset deleted file mode 100644 index c31bec52..00000000 --- a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/VisionLinkViewPortBG.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd673d7b47c8310bbae47b765919076a4b73cc20813122a3904f97950973435c -size 45518 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WBP_VisionLinkViewPort.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WBP_VisionLinkViewPort.uasset deleted file mode 100644 index 414cd557..00000000 --- a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WBP_VisionLinkViewPort.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:10ba4f55ea7d6e695bfa848cef4da05c40c2dbe3bbb6be34b00d711f0db12b7b -size 204366 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WBP_VisionLinkWatchFace.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WBP_VisionLinkWatchFace.uasset deleted file mode 100644 index b205dedf..00000000 --- a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WBP_VisionLinkWatchFace.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b05365476d12ad22f88a47f072cccc79b65376d67c4eb1ac21a02556c0922449 -size 162045 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFace/WBP_VisionLinkWatchFace.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFace/WBP_VisionLinkWatchFace.uasset new file mode 100644 index 00000000..f4473218 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFace/WBP_VisionLinkWatchFace.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc8393479c593c48fd8db154aa11f6ac9f5f6d5cd03ee4d93f2754556653dccb +size 161556 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFaceBGImage.png b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFace/WatchFaceBGImage.png similarity index 100% rename from EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFaceBGImage.png rename to EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFace/WatchFaceBGImage.png diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFace/WatchFaceBGImage.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFace/WatchFaceBGImage.uasset new file mode 100644 index 00000000..4e03bf1b --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFace/WatchFaceBGImage.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9aa56bafa97642804de02c9e00f3a77e0794167d534174993b616e8761757153 +size 19863 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFaceBGImage.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFaceBGImage.uasset deleted file mode 100644 index d05f935a..00000000 --- a/EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WatchFaceBGImage.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:afbeeb63e797939650edcf947c6d364fc2372b04290963f53cddc2025d7e4efa -size 19748 diff --git a/EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap b/EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap index 07001d61..cb32e614 100644 --- a/EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap +++ b/EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5e27a9b735217e9310c6c773ebb19ce87a4f00d959f0c4710de79ce8975be500 -size 109679 +oid sha256:4b05392dd6ea5c33327b50c71be4e3b736b96c356d8de84d894562af209c1f75 +size 103876 diff --git a/EndlessVendetta/Content/StarterContent/Audio/Collapse01.uasset b/EndlessVendetta/Content/StarterContent/Audio/Collapse01.uasset index 198f128d..5e3ff30e 100644 --- a/EndlessVendetta/Content/StarterContent/Audio/Collapse01.uasset +++ b/EndlessVendetta/Content/StarterContent/Audio/Collapse01.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:43d44b5a53fbbfc62522f67ad9523360b15677e3d0caeea96f4d9d0580a013cd -size 353935 +oid sha256:85c827023ee4b466228ec65e92b4b4a0415a106de041ac1c2cab481a2a5dfa8d +size 348532 diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index 0f990580..caa0814c 100644 --- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset +++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bc35eb2d43a47427d30aba0196f9eac90d089dd3abca319528c5d25c83510d0d -size 72364642 +oid sha256:81331a890b185a2c1bc418da80b947c289a8ab67ff91737e9b187c45c71d083d +size 66790690 diff --git a/EndlessVendetta/Content/UI/UI_Material_SeeThroughWalls.uasset b/EndlessVendetta/Content/UI/UI_Material_SeeThroughWalls.uasset new file mode 100644 index 00000000..c3067fb0 --- /dev/null +++ b/EndlessVendetta/Content/UI/UI_Material_SeeThroughWalls.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a38d567de25b3df88bbe21626983ee66de938d460d4c22aabc81f9790376222 +size 14569 diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp index 29b30310..1dbe1dd7 100644 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.cpp @@ -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(EnemyLOSTestActor, SpawnLoc, GetActorRotation(), SpawnParams); - //TArray EmptyFStringArray; - //Cast(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(GetWorld()->GetFirstPlayerController()->GetCharacter()->GetComponentByClass(UCameraComponent::StaticClass())); + TArray ActorsToIgnore; + ActorsToIgnore.Add(GetWorld()->GetFirstPlayerController()->GetCharacter()); + TestLOS(PlayerCamComp->GetComponentTransform(), ActorsToIgnore); } + +void AVisionLink::TestLOS(FTransform StartingPos, TArray &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); + } + } +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.h b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.h index fa5ac3e9..2a3b7789 100644 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.h +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLink.h @@ -23,6 +23,8 @@ class ENDLESSVENDETTA_API AVisionLink : public AReconGadget void SendOutPingPulse(); + void TestLOS(FTransform StartingPos, TArray &ActorsToIgnore); + virtual void BeginPlay() override; virtual void Activate() override; @@ -34,7 +36,19 @@ protected: int NumberOfPingPulses = 1; UPROPERTY(EditDefaultsOnly, Category = "Vision Link") - TSubclassOf 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); }; diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.cpp index b81b4d54..52c807f9 100644 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.cpp @@ -28,7 +28,7 @@ void AVisionLinkEnemyLOSTest::Tick(float DeltaTime) } -void AVisionLinkEnemyLOSTest::TestLOS(TArray EnemiesInLink, AActor* LOSActor) +void AVisionLinkEnemyLOSTest::TestLOS(TArray EnemiesInLink, AActor* LOSActor) { // Get all overlapping Actors UBoxComponent* CollisionBox = Cast(GetComponentByClass(UBoxComponent::StaticClass())); @@ -47,9 +47,12 @@ void AVisionLinkEnemyLOSTest::TestLOS(TArray 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 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(); diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.h b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.h index c9d6b81a..add35b97 100644 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.h +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/VisionLink/VisionLinkEnemyLOSTest.h @@ -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 EnemiesInLink, AActor* LOS_Actor); + void TestLOS(TArray EnemiesInLink, AActor* LOS_Actor); };