Skip to content
Snippets Groups Projects
Commit 0177b0c2 authored by Sebastian Pape's avatar Sebastian Pape
Browse files

Removed dependency and updated head translation calculation

parent 62ee2f55
Branches
No related tags found
2 merge requests!13Develop,!12Feature/dynamic spawning of overlay
......@@ -21,8 +21,7 @@
DEFINE_LOG_CATEGORY(LogCAVEOverlay);
template <std::size_t S>
bool ContainsFString(const std::array<FString, S>& Array, const FString& Entry)
bool ContainsFString(const TArray<FString>& Array, const FString& Entry)
{
for (FString Current_Entry : Array)
{
......@@ -279,7 +278,7 @@ bool ACAVEOverlayController::PositionInDoorOpening(FVector Position)
void ACAVEOverlayController::RefreshPawnComponents()
{
Cave_Origin = Player_Pawn->GetTrackingOriginComponent();
Shutter_Glasses = Player_Pawn->GetShutterGlassesComponent();
Head = Player_Pawn->GetHeadComponent();
}
// Called every frame
......@@ -289,7 +288,7 @@ void ACAVEOverlayController::Tick(float DeltaTime)
if (!bCAVE_Mode) return; // Not our business
if (!Cave_Origin || !Shutter_Glasses)
if (!Cave_Origin || !Head)
{
RefreshPawnComponents();
}
......@@ -313,10 +312,10 @@ void ACAVEOverlayController::Tick(float DeltaTime)
}
}
if (!Shutter_Glasses) return; //Display Cluster not initialized
if (!Head) return; //Display Cluster not initialized
//Tape Logic
FVector Shutter_Position = Shutter_Glasses->GetRelativeTransform().GetLocation();
FVector Shutter_Position = Cave_Origin->GetComponentLocation() - Head->GetComponentLocation();
bool bOverlay_Visible = FMath::IsWithinInclusive(Shutter_Position.GetAbsMax(), Wall_Distance - Wall_Close_Distance, Wall_Distance);
if (bOverlay_Visible && !PositionInDoorOpening(Shutter_Position))
......
......@@ -6,7 +6,6 @@
#include "GameFramework/Actor.h"
#include "DoorOverlayData.h"
#include "Engine/Engine.h"
#include <array>
#include "Components/StaticMeshComponent.h"
#include "Materials/Material.h"
#include "Materials/MaterialInstanceDynamic.h"
......@@ -39,9 +38,9 @@ private:
enum EScreen_Type { SCREEN_MASTER, SCREEN_NORMAL, SCREEN_DOOR_PARTIAL, SCREEN_DOOR };
EScreen_Type Screen_Type = SCREEN_NORMAL;
const std::array<FString, 4> Screens_Door = {"node_bul_left_eye", "node_bul_right_eye", "node_bll_left_eye", "node_bll_right_eye"};
const std::array<FString, 4> Screens_Door_Partial = {"node_bur_left_eye", "node_bur_right_eye", "node_blr_left_eye", "node_blr_right_eye"};
const std::array<FString, 5> Screens_FPS = {"node_rur_left_eye", "node_rur_right_eye", "node_lur_left_eye", "node_lur_right_eye", "node_main"};
const TArray<FString> Screens_Door = {"node_bul_left_eye", "node_bul_right_eye", "node_bll_left_eye", "node_bll_right_eye"};
const TArray<FString> Screens_Door_Partial = {"node_bur_left_eye", "node_bur_right_eye", "node_blr_left_eye", "node_blr_right_eye"};
const TArray<FString> Screens_FPS = {"node_rur_left_eye", "node_rur_right_eye", "node_lur_left_eye", "node_lur_right_eye", "node_main"};
const FString Screen_Main = "node_main";
//Door Mode
......@@ -73,7 +72,7 @@ private:
void RefreshPawnComponents();
AVirtualRealityPawn* Player_Pawn;
USceneComponent* Cave_Origin;
USceneComponent* Shutter_Glasses;
USceneComponent* Head;
//Cluster Events
FOnClusterEventListener ClusterEventListenerDelegate;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment