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

Merge branch 'develop'

parents 5063c0c8 bfd69b81
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"
}
);
......
#include "DisplayClusterGameModeCAVE.h"
#include "DisplayClusterPawnCAVE.h"
ADisplayClusterGameModeCAVE::ADisplayClusterGameModeCAVE() : Super()
{
if (!bIsDisplayClusterActive) return;
DefaultPawnClass = ADisplayClusterPawnCAVE::StaticClass();
}
#include "VirtualRealityGameMode.h"
#include "VirtualRealityPawn.h"
AVirtualRealityGameMode::AVirtualRealityGameMode() : Super()
{
if (!bIsDisplayClusterActive) return;
DefaultPawnClass = AVirtualRealityPawn::StaticClass();
}
#include "DisplayClusterPawnCAVE.h"
#include "VirtualRealityPawn.h"
#include "Cluster/IDisplayClusterClusterManager.h"
#include "Engine/World.h"
......@@ -7,9 +7,10 @@
#include "Input/IDisplayClusterInputManager.h"
#include "Kismet/GameplayStatics.h"
#include "DisplayClusterSettings.h"
#include "HeadMountedDisplayFunctionLibrary.h"
#include "IDisplayCluster.h"
ADisplayClusterPawnCAVE::ADisplayClusterPawnCAVE(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
AVirtualRealityPawn::AVirtualRealityPawn(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
MovementComponent = CreateDefaultSubobject<UFloatingPawnMovement> (TEXT("MovementComponent0"));
MovementComponent->UpdatedComponent = RootComponent;
......@@ -21,17 +22,19 @@ 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)
void AVirtualRealityPawn::OnForward_Implementation (float Value)
{
AddMovementInput(TranslationDirection->GetForwardVector(), Value);
}
void ADisplayClusterPawnCAVE::OnRight_Implementation (float Value)
void AVirtualRealityPawn::OnRight_Implementation (float Value)
{
AddMovementInput(TranslationDirection->GetRightVector (), Value);
}
void ADisplayClusterPawnCAVE::OnTurnRate_Implementation (float Rate )
void AVirtualRealityPawn::OnTurnRate_Implementation (float Rate )
{
if (IDisplayCluster::Get().GetOperationMode() == EDisplayClusterOperationMode::Cluster)
{
......@@ -46,7 +49,7 @@ void ADisplayClusterPawnCAVE::OnTurnRate_Implementation (flo
AddControllerYawInput(BaseTurnRate * Rate * GetWorld()->GetDeltaSeconds() * CustomTimeDilation);
}
}
void ADisplayClusterPawnCAVE::OnLookUpRate_Implementation(float Rate )
void AVirtualRealityPawn::OnLookUpRate_Implementation(float Rate )
{
if (IDisplayCluster::Get().GetOperationMode() == EDisplayClusterOperationMode::Cluster)
{
......@@ -57,16 +60,16 @@ void ADisplayClusterPawnCAVE::OnLookUpRate_Implementation(flo
AddControllerPitchInput(BaseTurnRate * Rate * GetWorld()->GetDeltaSeconds() * CustomTimeDilation);
}
}
void ADisplayClusterPawnCAVE::OnFire_Implementation (bool Pressed)
void AVirtualRealityPawn::OnFire_Implementation (bool Pressed)
{
}
void ADisplayClusterPawnCAVE::OnAction_Implementation (bool Pressed, int32 Index)
void AVirtualRealityPawn::OnAction_Implementation (bool Pressed, int32 Index)
{
}
void ADisplayClusterPawnCAVE::BeginPlay ()
void AVirtualRealityPawn::BeginPlay ()
{
Super::BeginPlay();
......@@ -87,8 +90,19 @@ 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)
void AVirtualRealityPawn::Tick (float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
......@@ -99,38 +113,38 @@ void ADisplayClusterPawnCAVE::Tick (flo
TranslationDirection = Flystick;
}
}
void ADisplayClusterPawnCAVE::BeginDestroy ()
void AVirtualRealityPawn::BeginDestroy ()
{
Super::BeginDestroy();
}
void ADisplayClusterPawnCAVE::SetupPlayerInputComponent (UInputComponent* PlayerInputComponent)
void AVirtualRealityPawn::SetupPlayerInputComponent (UInputComponent* PlayerInputComponent)
{
check(PlayerInputComponent);
Super::SetupPlayerInputComponent(PlayerInputComponent);
if (PlayerInputComponent)
{
PlayerInputComponent->BindAxis ("MoveForward" , this, &ADisplayClusterPawnCAVE::OnForward );
PlayerInputComponent->BindAxis ("MoveRight" , this, &ADisplayClusterPawnCAVE::OnRight );
PlayerInputComponent->BindAxis ("TurnRate" , this, &ADisplayClusterPawnCAVE::OnTurnRate );
PlayerInputComponent->BindAxis ("LookUpRate" , this, &ADisplayClusterPawnCAVE::OnLookUpRate );
PlayerInputComponent->BindAxis ("MoveForward" , this, &AVirtualRealityPawn::OnForward );
PlayerInputComponent->BindAxis ("MoveRight" , this, &AVirtualRealityPawn::OnRight );
PlayerInputComponent->BindAxis ("TurnRate" , this, &AVirtualRealityPawn::OnTurnRate );
PlayerInputComponent->BindAxis ("LookUpRate" , this, &AVirtualRealityPawn::OnLookUpRate );
PlayerInputComponent->BindAction<FFireDelegate> ("Fire" , IE_Pressed , this, &ADisplayClusterPawnCAVE::OnFire , true );
PlayerInputComponent->BindAction<FActionDelegate>("Action1" , IE_Pressed , this, &ADisplayClusterPawnCAVE::OnAction , true , 1);
PlayerInputComponent->BindAction<FActionDelegate>("Action2" , IE_Pressed , this, &ADisplayClusterPawnCAVE::OnAction , true , 2);
PlayerInputComponent->BindAction<FActionDelegate>("Action3" , IE_Pressed , this, &ADisplayClusterPawnCAVE::OnAction , true , 3);
PlayerInputComponent->BindAction<FActionDelegate>("Action4" , IE_Pressed , this, &ADisplayClusterPawnCAVE::OnAction , true , 4);
PlayerInputComponent->BindAction<FActionDelegate>("Action5" , IE_Pressed , this, &ADisplayClusterPawnCAVE::OnAction , true , 5);
PlayerInputComponent->BindAction<FFireDelegate> ("Fire" , IE_Pressed , this, &AVirtualRealityPawn::OnFire , true );
PlayerInputComponent->BindAction<FActionDelegate>("Action1" , IE_Pressed , this, &AVirtualRealityPawn::OnAction , true , 1);
PlayerInputComponent->BindAction<FActionDelegate>("Action2" , IE_Pressed , this, &AVirtualRealityPawn::OnAction , true , 2);
PlayerInputComponent->BindAction<FActionDelegate>("Action3" , IE_Pressed , this, &AVirtualRealityPawn::OnAction , true , 3);
PlayerInputComponent->BindAction<FActionDelegate>("Action4" , IE_Pressed , this, &AVirtualRealityPawn::OnAction , true , 4);
PlayerInputComponent->BindAction<FActionDelegate>("Action5" , IE_Pressed , this, &AVirtualRealityPawn::OnAction , true , 5);
PlayerInputComponent->BindAction<FFireDelegate> ("Fire" , IE_Released, this, &ADisplayClusterPawnCAVE::OnFire , false );
PlayerInputComponent->BindAction<FActionDelegate>("Action1" , IE_Released, this, &ADisplayClusterPawnCAVE::OnAction , false, 1);
PlayerInputComponent->BindAction<FActionDelegate>("Action2" , IE_Released, this, &ADisplayClusterPawnCAVE::OnAction , false, 2);
PlayerInputComponent->BindAction<FActionDelegate>("Action3" , IE_Released, this, &ADisplayClusterPawnCAVE::OnAction , false, 3);
PlayerInputComponent->BindAction<FActionDelegate>("Action4" , IE_Released, this, &ADisplayClusterPawnCAVE::OnAction , false, 4);
PlayerInputComponent->BindAction<FActionDelegate>("Action5" , IE_Released, this, &ADisplayClusterPawnCAVE::OnAction , false, 5);
PlayerInputComponent->BindAction<FFireDelegate> ("Fire" , IE_Released, this, &AVirtualRealityPawn::OnFire , false );
PlayerInputComponent->BindAction<FActionDelegate>("Action1" , IE_Released, this, &AVirtualRealityPawn::OnAction , false, 1);
PlayerInputComponent->BindAction<FActionDelegate>("Action2" , IE_Released, this, &AVirtualRealityPawn::OnAction , false, 2);
PlayerInputComponent->BindAction<FActionDelegate>("Action3" , IE_Released, this, &AVirtualRealityPawn::OnAction , false, 3);
PlayerInputComponent->BindAction<FActionDelegate>("Action4" , IE_Released, this, &AVirtualRealityPawn::OnAction , false, 4);
PlayerInputComponent->BindAction<FActionDelegate>("Action5" , IE_Released, this, &AVirtualRealityPawn::OnAction , false, 5);
}
}
UPawnMovementComponent* ADisplayClusterPawnCAVE::GetMovementComponent () const
UPawnMovementComponent* AVirtualRealityPawn::GetMovementComponent () const
{
return MovementComponent;
}
......@@ -3,13 +3,13 @@
#include "CoreMinimal.h"
#include "DisplayClusterGameMode.h"
#include "DisplayClusterGameModeCAVE.generated.h"
#include "VirtualRealityGameMode.generated.h"
UCLASS()
class DISPLAYCLUSTEREXTENSIONS_API ADisplayClusterGameModeCAVE : public ADisplayClusterGameMode
class DISPLAYCLUSTEREXTENSIONS_API AVirtualRealityGameMode : public ADisplayClusterGameMode
{
GENERATED_BODY()
public:
ADisplayClusterGameModeCAVE();
AVirtualRealityGameMode();
};
\ No newline at end of file
......@@ -6,11 +6,12 @@
#include "CoreMinimal.h"
#include "DisplayClusterPawn.h"
#include "DisplayClusterSceneComponent.h"
#include "MotionControllerComponent.h"
#include "DisplayClusterPawnCAVE.generated.h"
#include "VirtualRealityPawn.generated.h"
UCLASS()
class DISPLAYCLUSTEREXTENSIONS_API ADisplayClusterPawnCAVE : public ADisplayClusterPawn
class DISPLAYCLUSTEREXTENSIONS_API AVirtualRealityPawn : public ADisplayClusterPawn
{
GENERATED_UCLASS_BODY()
......@@ -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