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

Added HMD interoperation support. Naming no longer appropriate.

parent bbcb3fb0
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@ public class DisplayClusterExtensions : ModuleRules
"DisplayCluster",
"DisplayClusterInput",
"Engine",
"HeadMountedDisplay",
"InputCore"
}
);
......
......@@ -7,6 +7,7 @@
#include "Input/IDisplayClusterInputManager.h"
#include "Kismet/GameplayStatics.h"
#include "DisplayClusterSettings.h"
#include "HeadMountedDisplayFunctionLibrary.h"
#include "IDisplayCluster.h"
ADisplayClusterPawnCAVE::ADisplayClusterPawnCAVE(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
......@@ -21,6 +22,8 @@ ADisplayClusterPawnCAVE::ADisplayClusterPawnCAVE(const FObjectInitializer& Objec
RotatingComponent->RotationRate = FRotator::ZeroRotator;
TranslationDirection = RootComponent;
AutoPossessPlayer = EAutoReceiveInput::Player0; // Necessary for receiving motion controller events.
}
void ADisplayClusterPawnCAVE::OnForward_Implementation (float Value)
......@@ -87,6 +90,17 @@ void ADisplayClusterPawnCAVE::BeginPlay ()
MovementComponent->Deceleration = Settings->MovementDeceleration;
MovementComponent->TurningBoost = Settings->MovementTurningBoost;
BaseTurnRate = Settings->RotationSpeed ;
if (UHeadMountedDisplayFunctionLibrary::IsHeadMountedDisplayEnabled())
{
LeftMotionControllerComponent = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("LeftMotionControllerComponent"));
LeftMotionControllerComponent->SetTrackingSource (EControllerHand::Left);
LeftMotionControllerComponent->SetShowDeviceModel(true);
RightMotionControllerComponent = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("RightMotionControllerComponent"));
RightMotionControllerComponent->SetTrackingSource (EControllerHand::Right);
RightMotionControllerComponent->SetShowDeviceModel(true);
}
}
void ADisplayClusterPawnCAVE::Tick (float DeltaSeconds)
{
......
......@@ -6,6 +6,7 @@
#include "CoreMinimal.h"
#include "DisplayClusterPawn.h"
#include "DisplayClusterSceneComponent.h"
#include "MotionControllerComponent.h"
#include "DisplayClusterPawnCAVE.generated.h"
......@@ -37,4 +38,6 @@ protected:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Pawn", meta = (AllowPrivateAccess = "true")) UFloatingPawnMovement* MovementComponent = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Pawn", meta = (AllowPrivateAccess = "true")) URotatingMovementComponent* RotatingComponent = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Pawn", meta = (AllowPrivateAccess = "true")) UMotionControllerComponent* LeftMotionControllerComponent = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Pawn", meta = (AllowPrivateAccess = "true")) UMotionControllerComponent* RightMotionControllerComponent = nullptr;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment