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

Reformatting code, redefine key to action, adding fps counter

parent 7dd9f614
No related branches found
No related tags found
1 merge request!4Develop
No preview for this file type
This diff is collapsed.
...@@ -5,25 +5,16 @@ ...@@ -5,25 +5,16 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/Actor.h" #include "GameFramework/Actor.h"
#include "DoorOverlayData.h" #include "DoorOverlayData.h"
#include "HeadMountedDisplayFunctionLibrary.h"
#include "IDisplayCluster.h"
#include "Engine/Engine.h" #include "Engine/Engine.h"
#include "IXRTrackingSystem.h"
#include "Components/InputComponent.h"
#include "Cluster/IDisplayClusterClusterManager.h"
#include "IDisplayClusterGameManager.h"
#include "InputCoreTypes.h"
#include "UObject/ConstructorHelpers.h"
#include <array> #include <array>
#include "Components/StaticMeshComponent.h" #include "Components/StaticMeshComponent.h"
#include "Engine/Engine.h"
#include "Materials/Material.h" #include "Materials/Material.h"
#include "Materials/MaterialInstanceDynamic.h" #include "Materials/MaterialInstanceDynamic.h"
#include "DisplayClusterExtensions/Public/VirtualRealityPawn.h" #include "DisplayClusterExtensions/Public/VirtualRealityPawn.h"
#include "DisplayCluster/Public/DisplayClusterSceneComponent.h" #include "DisplayCluster/Public/DisplayClusterSceneComponent.h"
#include "CAVEOverlayController.generated.h" #include "CAVEOverlayController.generated.h"
DECLARE_LOG_CATEGORY_EXTERN(CAVEOverlayLog, Log, All); DECLARE_LOG_CATEGORY_EXTERN(LogCAVEOverlay, Log, All);
UCLASS() UCLASS()
class CAVEOVERLAY_API ACAVEOverlayController : public AActor class CAVEOVERLAY_API ACAVEOverlayController : public AActor
...@@ -38,45 +29,48 @@ protected: ...@@ -38,45 +29,48 @@ protected:
private: private:
//Execution Modes //Execution Modes
bool hmd_mode_ = false; bool bHMD_Mode = false;
bool display_cluster_mode_ = false; bool bDisplay_Cluster_Mode = false;
//Screen Types //Screen Types
enum SCREEEN_TYPE { SCREEN_MASTER, SCREEN_NORMAL, SCREEN_DOOR_PARTIAL, SCREEN_DOOR }; enum EScreen_Type { SCREEN_MASTER, SCREEN_NORMAL, SCREEN_DOOR_PARTIAL, SCREEN_DOOR };
SCREEEN_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"}; EScreen_Type Screen_Type = SCREEN_NORMAL;
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, 4> Screens_Door = {"node_bul_left_eye", "node_bul_right_eye", "node_bll_left_eye", "node_bll_right_eye"};
const FString screen_main = "node_main"; 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 FString Screen_Main = "node_main";
//Door Mode //Door Mode
enum DOOR_MODE { DOOR_CLOSED = 0, DOOR_OPEN = 1, DOOR_PARTIALLY_OPEN = 2, DOOR_NUM_MODES = 3}; enum EDoor_Mode { DOOR_PARTIALLY_OPEN = 0, DOOR_OPEN = 1, DOOR_CLOSED = 2, DOOR_DEBUG = 3, DOOR_NUM_MODES = 4 };
const FString door_mode_names_[DOOR_NUM_MODES] = {"Closed", "Open", "Partially Open" };
DOOR_MODE door_current_mode_ = DOOR_PARTIALLY_OPEN; const FString Door_Mode_Names[DOOR_NUM_MODES] = {"Partially Open", "Open", "Closed", "Debug"};
const float door_opening_width_relative_ = 0.522; //%, used for the overlay width on the screen EDoor_Mode Door_Current_Mode = DOOR_PARTIALLY_OPEN;
const float door_opening_width_absolute_ = 165; //cm, used for the non tape part at the door const float Door_Opening_Width_Relative = 0.522; //%, used for the overlay width on the screen
const float wall_distance_ = 262.5; //cm, distance from center to a wall, *2 = wall width const float Door_Opening_Width_Absolute = 165; //cm, used for the non tape part at the door
const float wall_close_distance_ = 75; //cm, the distance considered to be too close to the walls const float Wall_Distance = 262.5; //cm, distance from center to a wall, *2 = wall width
const float wall_fade_distance_ = 35; //cm, the distance over which the tape is faded const float Wall_Close_Distance = 75; //cm, the distance considered to be too close to the walls
const float wall_warning_distance_ = 40; //cm, distance on which the tape turns red, measurred from wall const float Wall_Fade_Distance = 35; //cm, the distance over which the tape is faded
float door_current_opening_width_absolute_ = 0; const float Wall_Warning_Distance = 40; //cm, distance on which the tape turns red, measured from wall
float Door_Current_Opening_Width_Absolute = 0;
//Overlay //Overlay
TSubclassOf<class UDoorOverlayData> overlay_class_; TSubclassOf<class UDoorOverlayData> Overlay_Class;
UDoorOverlayData* overlay_; UDoorOverlayData* Overlay;
//Geometry and Material //Geometry and Material
UStaticMeshComponent* createMeshComponent(const FName &name, UStaticMesh* mesh, USceneComponent* parent); UStaticMeshComponent* CreateMeshComponent(const FName& Name, UStaticMesh* Mesh, USceneComponent* Parent);
UMaterial* tape_material_ = nullptr; UMaterial* Tape_Material = nullptr;
UMaterial* sign_material_ = nullptr; UMaterial* Sign_Material = nullptr;
float calculateOpacityFromPosition(FVector position); float CalculateOpacityFromPosition(FVector Position);
bool positionInDoorOpening(FVector position); bool PositionInDoorOpening(FVector Position);
//Pawn Components //Pawn Components
bool attached_ = false; bool bAttached = false;
void refreshPawnComponents(); void RefreshPawnComponents();
AVirtualRealityPawn* player_pawn_; AVirtualRealityPawn* Player_Pawn;
UDisplayClusterSceneComponent* cave_origin_; UDisplayClusterSceneComponent* Cave_Origin;
UDisplayClusterSceneComponent* shutter_glasses_; UDisplayClusterSceneComponent* Shutter_Glasses;
public: public:
...@@ -84,24 +78,24 @@ public: ...@@ -84,24 +78,24 @@ public:
virtual void Tick(float DeltaTime) override; virtual void Tick(float DeltaTime) override;
void CycleDoorType(); void CycleDoorType();
void SetDoorMode(DOOR_MODE m); void SetDoorMode(EDoor_Mode M);
//Signs and Banners //Signs and Banners
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) USceneComponent* root = nullptr; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) USceneComponent* Root = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) USceneComponent* tape_root = nullptr; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) USceneComponent* Tape_Root = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) USceneComponent* sign_root = nullptr; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) USceneComponent* Sign_Root = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* tape_negative_y = nullptr; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* Tape_Negative_Y = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* tape_negative_x = nullptr; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* Tape_Negative_X = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* tape_positive_y = nullptr; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* Tape_Positive_Y = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* tape_positive_x = nullptr; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* Tape_Positive_X = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* sign_negative_y = nullptr; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* Sign_Negative_Y = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* sign_negative_x = nullptr; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* Sign_Negative_X = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* sign_positive_y = nullptr; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* Sign_Positive_Y = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* sign_positive_x = nullptr; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CAVEOverlay", meta = (AllowPrivateAccess = "true")) UStaticMeshComponent* Sign_Positive_X = nullptr;
UMaterialInstanceDynamic* tape_material_dynamic_ = nullptr; UMaterialInstanceDynamic* Tape_Material_Dynamic_ = nullptr;
UMaterialInstanceDynamic* sign_material_dynamic_ = nullptr; UMaterialInstanceDynamic* Sign_Material_Dynamic_ = nullptr;
UStaticMesh* plane_mesh_ = nullptr; UStaticMesh* Plane_Mesh_ = nullptr;
}; };
...@@ -24,4 +24,7 @@ public: ...@@ -24,4 +24,7 @@ public:
UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
UBorder* BlackBox; UBorder* BlackBox;
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
UTextBlock* FPS;
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment