Skip to content
Snippets Groups Projects
Commit 267b7ba8 authored by Ali Can Demiralp's avatar Ali Can Demiralp
Browse files

Restructuring progress.

parent 987a48ad
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "Kismet/GameplayStatics.h" #include "Kismet/GameplayStatics.h"
#include "DisplayClusterSettings.h" #include "DisplayClusterSettings.h"
#include "HeadMountedDisplayFunctionLibrary.h" #include "HeadMountedDisplayFunctionLibrary.h"
#include "IDisplayClusterConfigManager.h"
#include "IDisplayCluster.h" #include "IDisplayCluster.h"
#include "IXRTrackingSystem.h" #include "IXRTrackingSystem.h"
...@@ -98,6 +99,14 @@ bool AVirtualRealityPawn::IsHeadMountedMode ...@@ -98,6 +99,14 @@ bool AVirtualRealityPawn::IsHeadMountedMode
return GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed(); return GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed();
} }
FString AVirtualRealityPawn::GetNodeName ()
{
return IsRoomMountedMode() ? IDisplayCluster::Get().GetClusterMgr()->GetNodeId() : FString(TEXT("Localhost"));
}
float AVirtualRealityPawn::GetEyeDistance()
{
return IDisplayCluster::Get().GetConfigMgr()->GetConfigStereo().EyeDist;
}
float AVirtualRealityPawn::GetBaseTurnRate () const float AVirtualRealityPawn::GetBaseTurnRate () const
{ {
...@@ -176,7 +185,7 @@ void AVirtualRealityPawn::BeginPlay ...@@ -176,7 +185,7 @@ void AVirtualRealityPawn::BeginPlay
LeftHand = Flystick; LeftHand = Flystick;
RightHand = Flystick; RightHand = Flystick;
// TODO RootComponent->SetWorldLocation(FVector(0, 2, 0), false, nullptr, ETeleportType::None);
} }
else if (IsHeadMountedMode()) else if (IsHeadMountedMode())
{ {
...@@ -228,19 +237,20 @@ void AVirtualRealityPawn::SetupPlayerInputComponent ...@@ -228,19 +237,20 @@ void AVirtualRealityPawn::SetupPlayerInputComponent
PlayerInputComponent->BindAxis ("TurnRate" , this, &AVirtualRealityPawn::OnTurnRate ); PlayerInputComponent->BindAxis ("TurnRate" , this, &AVirtualRealityPawn::OnTurnRate );
PlayerInputComponent->BindAxis ("LookUpRate" , this, &AVirtualRealityPawn::OnLookUpRate); PlayerInputComponent->BindAxis ("LookUpRate" , this, &AVirtualRealityPawn::OnLookUpRate);
PlayerInputComponent->BindAction<FFireDelegate> ("Fire" , IE_Pressed , this, &AVirtualRealityPawn::OnFire , true ); // The button names are based on the definitions in aixcave_422.cfg.
PlayerInputComponent->BindAction<FActionDelegate>("Action1" , IE_Pressed , this, &AVirtualRealityPawn::OnAction , true , 1); PlayerInputComponent->BindAction<FFireDelegate> ("nDisplayButton0", IE_Pressed , this, &AVirtualRealityPawn::OnFire , true );
PlayerInputComponent->BindAction<FActionDelegate>("Action2" , IE_Pressed , this, &AVirtualRealityPawn::OnAction , true , 2); PlayerInputComponent->BindAction<FActionDelegate>("nDisplayButton1", IE_Pressed , this, &AVirtualRealityPawn::OnAction, true , 1);
PlayerInputComponent->BindAction<FActionDelegate>("Action3" , IE_Pressed , this, &AVirtualRealityPawn::OnAction , true , 3); PlayerInputComponent->BindAction<FActionDelegate>("nDisplayButton2", IE_Pressed , this, &AVirtualRealityPawn::OnAction, true , 2);
PlayerInputComponent->BindAction<FActionDelegate>("Action4" , IE_Pressed , this, &AVirtualRealityPawn::OnAction , true , 4); PlayerInputComponent->BindAction<FActionDelegate>("nDisplayButton3", IE_Pressed , this, &AVirtualRealityPawn::OnAction, true , 3);
PlayerInputComponent->BindAction<FActionDelegate>("Action5" , IE_Pressed , this, &AVirtualRealityPawn::OnAction , true , 5); PlayerInputComponent->BindAction<FActionDelegate>("nDisplayButton4", IE_Pressed , this, &AVirtualRealityPawn::OnAction, true , 4);
PlayerInputComponent->BindAction<FActionDelegate>("nDisplayButton5", IE_Pressed , this, &AVirtualRealityPawn::OnAction, true , 5);
PlayerInputComponent->BindAction<FFireDelegate> ("Fire" , IE_Released, this, &AVirtualRealityPawn::OnFire , false );
PlayerInputComponent->BindAction<FActionDelegate>("Action1" , IE_Released, this, &AVirtualRealityPawn::OnAction , false, 1); PlayerInputComponent->BindAction<FFireDelegate> ("nDisplayButton0", IE_Released, this, &AVirtualRealityPawn::OnFire , false );
PlayerInputComponent->BindAction<FActionDelegate>("Action2" , IE_Released, this, &AVirtualRealityPawn::OnAction , false, 2); PlayerInputComponent->BindAction<FActionDelegate>("nDisplayButton1", IE_Released, this, &AVirtualRealityPawn::OnAction, false, 1);
PlayerInputComponent->BindAction<FActionDelegate>("Action3" , IE_Released, this, &AVirtualRealityPawn::OnAction , false, 3); PlayerInputComponent->BindAction<FActionDelegate>("nDisplayButton2", IE_Released, this, &AVirtualRealityPawn::OnAction, false, 2);
PlayerInputComponent->BindAction<FActionDelegate>("Action4" , IE_Released, this, &AVirtualRealityPawn::OnAction , false, 4); PlayerInputComponent->BindAction<FActionDelegate>("nDisplayButton3", IE_Released, this, &AVirtualRealityPawn::OnAction, false, 3);
PlayerInputComponent->BindAction<FActionDelegate>("Action5" , IE_Released, this, &AVirtualRealityPawn::OnAction , false, 5); PlayerInputComponent->BindAction<FActionDelegate>("nDisplayButton4", IE_Released, this, &AVirtualRealityPawn::OnAction, false, 4);
PlayerInputComponent->BindAction<FActionDelegate>("nDisplayButton5", IE_Released, this, &AVirtualRealityPawn::OnAction, false, 5);
} }
} }
UPawnMovementComponent* AVirtualRealityPawn::GetMovementComponent () const UPawnMovementComponent* AVirtualRealityPawn::GetMovementComponent () const
......
...@@ -33,6 +33,9 @@ public: ...@@ -33,6 +33,9 @@ public:
UFUNCTION(BlueprintCallable, Category = "Pawn") bool IsRoomMountedMode (); UFUNCTION(BlueprintCallable, Category = "Pawn") bool IsRoomMountedMode ();
UFUNCTION(BlueprintCallable, Category = "Pawn") bool IsHeadMountedMode (); UFUNCTION(BlueprintCallable, Category = "Pawn") bool IsHeadMountedMode ();
UFUNCTION(BlueprintCallable, Category = "Pawn") FString GetNodeName ();
UFUNCTION(BlueprintCallable, Category = "Pawn") float GetEyeDistance ();
UFUNCTION(BlueprintCallable, Category = "Pawn") float GetBaseTurnRate () const; UFUNCTION(BlueprintCallable, Category = "Pawn") float GetBaseTurnRate () const;
UFUNCTION(BlueprintCallable, Category = "Pawn") UFloatingPawnMovement* GetFloatingPawnMovement (); UFUNCTION(BlueprintCallable, Category = "Pawn") UFloatingPawnMovement* GetFloatingPawnMovement ();
UFUNCTION(BlueprintCallable, Category = "Pawn") URotatingMovementComponent* GetRotatingMovementComponent (); UFUNCTION(BlueprintCallable, Category = "Pawn") URotatingMovementComponent* GetRotatingMovementComponent ();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment