diff --git a/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp b/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp index 1ffd3ceebc37b70a4f0fa96690f5424b88fd731a..b8c05066224eaeb71a45ee487ee2d812f78f4d81 100644 --- a/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp +++ b/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp @@ -14,7 +14,7 @@ #include "Logging/StructuredLog.h" #include "Materials/MaterialInstanceDynamic.h" #include "Pawn/VirtualRealityPawn.h" -#include "Utility/VirtualRealityUtilities.h" +#include "Utility/RWTHVRUtilities.h" DEFINE_LOG_CATEGORY(LogCAVEOverlay); @@ -160,11 +160,11 @@ void ACAVEOverlayController::BeginPlay() // Not sure which place would be best... const bool bValidPC = PC && PC->GetLocalPlayer(); - if (!bValidPC || !UVirtualRealityUtilities::IsRoomMountedMode()) + if (!bValidPC || !URWTHVRUtilities::IsRoomMountedMode()) return; //Input config - if (UVirtualRealityUtilities::IsPrimaryNode()) + if (URWTHVRUtilities::IsPrimaryNode()) { if (CycleDoorTypeInputAction == nullptr || IMCCaveOverlayInputMapping == nullptr) { diff --git a/Source/RWTHVRCluster/Private/CaveSetup.cpp b/Source/RWTHVRCluster/Private/CaveSetup.cpp index debb2b14c4f49de450c60c9c393932bcff61d1b5..da178a98f0fdceaacee7bd4c3b331fbc0e8bf621 100644 --- a/Source/RWTHVRCluster/Private/CaveSetup.cpp +++ b/Source/RWTHVRCluster/Private/CaveSetup.cpp @@ -4,7 +4,7 @@ #include "CaveSetup.h" #include "Logging/StructuredLog.h" -#include "Utility/VirtualRealityUtilities.h" +#include "Utility/RWTHVRUtilities.h" // Sets default values @@ -22,7 +22,7 @@ void ACaveSetup::BeginPlay() { Super::BeginPlay(); - if (!UVirtualRealityUtilities::IsRoomMountedMode()) + if (!URWTHVRUtilities::IsRoomMountedMode()) { return; } @@ -41,7 +41,7 @@ void ACaveSetup::BeginPlay() // Apply the DTrack LiveLink Preset. Only do this if we are the primaryNode - if (UVirtualRealityUtilities::IsPrimaryNode()) + if (URWTHVRUtilities::IsPrimaryNode()) { if (LiveLinkPresetToApplyOnCave && LiveLinkPresetToApplyOnCave->IsValidLowLevelFast()) { diff --git a/Source/RWTHVRToolkit/Private/Core/RWTHVRGameModeBase.cpp b/Source/RWTHVRToolkit/Private/Core/RWTHVRGameModeBase.cpp index 78f9d34ad46c2dfc83254d14180a69dd68943b42..dfc80f27c13289b3a40dbbd728adeb8ec2314674 100644 --- a/Source/RWTHVRToolkit/Private/Core/RWTHVRGameModeBase.cpp +++ b/Source/RWTHVRToolkit/Private/Core/RWTHVRGameModeBase.cpp @@ -7,7 +7,7 @@ #include "GameFramework/SpectatorPawn.h" #include "Kismet/GameplayStatics.h" #include "Logging/StructuredLog.h" -#include "Utility/VirtualRealityUtilities.h" +#include "Utility/RWTHVRUtilities.h" FString ARWTHVRGameModeBase::InitNewPlayer(APlayerController* NewPlayerController, const FUniqueNetIdRepl& UniqueId, diff --git a/Source/RWTHVRToolkit/Private/Interaction/Interactors/VRWidgetInteractionComponent.cpp b/Source/RWTHVRToolkit/Private/Interaction/Interactors/VRWidgetInteractionComponent.cpp index 4d2f6ad0f575de14bc2922786780abada43ed45a..49e6de4f67ecf041f2e40344038a83181107f079 100644 --- a/Source/RWTHVRToolkit/Private/Interaction/Interactors/VRWidgetInteractionComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Interaction/Interactors/VRWidgetInteractionComponent.cpp @@ -8,7 +8,7 @@ #include "Interaction/Interactors/GrabComponent.h" #include "Logging/StructuredLog.h" #include "Misc/Optional.h" -#include "Utility/VirtualRealityUtilities.h" +#include "Utility/RWTHVRUtilities.h" UVRWidgetInteractionComponent::UVRWidgetInteractionComponent() { diff --git a/Source/RWTHVRToolkit/Private/Pawn/Navigation/ContinuousMovementComponent.cpp b/Source/RWTHVRToolkit/Private/Pawn/Navigation/ContinuousMovementComponent.cpp index 670197c36e478e55468eb899553f294df53a3cfd..19b461a2b8a55978141906fb98ac98a645410a94 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/Navigation/ContinuousMovementComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/Navigation/ContinuousMovementComponent.cpp @@ -6,7 +6,7 @@ #include "EnhancedInputSubsystems.h" #include "Engine/LocalPlayer.h" #include "GameFramework/PlayerController.h" -#include "Utility/VirtualRealityUtilities.h" +#include "Utility/RWTHVRUtilities.h" #include "MotionControllerComponent.h" void UContinuousMovementComponent::SetupPlayerInput(UInputComponent* PlayerInputComponent) @@ -54,7 +54,7 @@ void UContinuousMovementComponent::OnMove(const FInputActionValue& Value) if (!VRPawn || !VRPawn->Controller) return; - const bool bGazeDirected = UVirtualRealityUtilities::IsDesktopMode() || SteeringMode == + const bool bGazeDirected = URWTHVRUtilities::IsDesktopMode() || SteeringMode == EVRSteeringModes::STEER_GAZE_DIRECTED; const FVector ForwardDir = bGazeDirected diff --git a/Source/RWTHVRToolkit/Private/Pawn/Navigation/MovementComponentBase.cpp b/Source/RWTHVRToolkit/Private/Pawn/Navigation/MovementComponentBase.cpp index ba54799865751343d2ecd9a9dbdd479ac213763b..fc5a2d40ad0d2096e3b87386ded86910b269ee04 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/Navigation/MovementComponentBase.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/Navigation/MovementComponentBase.cpp @@ -7,7 +7,7 @@ #include "Engine/LocalPlayer.h" #include "GameFramework/PlayerController.h" #include "Pawn/VirtualRealityPawn.h" -#include "Utility/VirtualRealityUtilities.h" +#include "Utility/RWTHVRUtilities.h" void UMovementComponentBase::SetupPlayerInput(UInputComponent* PlayerInputComponent) { diff --git a/Source/RWTHVRToolkit/Private/Pawn/Navigation/TeleportationComponent.cpp b/Source/RWTHVRToolkit/Private/Pawn/Navigation/TeleportationComponent.cpp index 906baaf59d5197516d6be7b4fc75aaba6bf28053..29b3fda86929d0106488a9eca83965b246095d35 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/Navigation/TeleportationComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/Navigation/TeleportationComponent.cpp @@ -11,7 +11,7 @@ #include "NiagaraFunctionLibrary.h" #include "Kismet/GameplayStatics.h" #include "NiagaraDataInterfaceArrayFunctionLibrary.h" -#include "Utility/VirtualRealityUtilities.h" +#include "Utility/RWTHVRUtilities.h" #include "MotionControllerComponent.h" diff --git a/Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp b/Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp index 800d10a26d2b91f8c4eba6b0229ccc3dde9d7641..c0bd5ad260858c0262ae34191f7e0fff650d827e 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp @@ -6,7 +6,7 @@ #include "EnhancedInputComponent.h" #include "EnhancedInputSubsystems.h" #include "Pawn/VirtualRealityPawn.h" -#include "Utility/VirtualRealityUtilities.h" +#include "Utility/RWTHVRUtilities.h" void UTurnComponent::SetupPlayerInput(UInputComponent* PlayerInputComponent) { @@ -34,7 +34,7 @@ void UTurnComponent::SetupPlayerInput(UInputComponent* PlayerInputComponent) } // add Input Mapping context - InputSubsystem->AddMappingContext(UVirtualRealityUtilities::IsDesktopMode() ? IMCDesktopRotation : IMCTurn, 0); + InputSubsystem->AddMappingContext(URWTHVRUtilities::IsDesktopMode() ? IMCDesktopRotation : IMCTurn, 0); UEnhancedInputComponent* EI = Cast<UEnhancedInputComponent>(PlayerInputComponent); @@ -48,7 +48,7 @@ void UTurnComponent::SetupPlayerInput(UInputComponent* PlayerInputComponent) if (bAllowTurning) { // no snap turning for desktop mode - if (bSnapTurn && !UVirtualRealityUtilities::IsDesktopMode()) + if (bSnapTurn && !URWTHVRUtilities::IsDesktopMode()) { EI->BindAction(Turn, ETriggerEvent::Started, this, &UTurnComponent::OnBeginSnapTurn); } @@ -59,7 +59,7 @@ void UTurnComponent::SetupPlayerInput(UInputComponent* PlayerInputComponent) } // bind additional functions for desktop rotations - if (UVirtualRealityUtilities::IsDesktopMode()) + if (URWTHVRUtilities::IsDesktopMode()) { EI->BindAction(DesktopRotation, ETriggerEvent::Started, this, &UTurnComponent::StartDesktopRotation); EI->BindAction(DesktopRotation, ETriggerEvent::Completed, this, &UTurnComponent::EndDesktopRotation); @@ -79,7 +79,7 @@ void UTurnComponent::EndDesktopRotation() void UTurnComponent::OnBeginTurn(const FInputActionValue& Value) { - if (UVirtualRealityUtilities::IsDesktopMode() && !bApplyDesktopRotation) + if (URWTHVRUtilities::IsDesktopMode() && !bApplyDesktopRotation) return; if (!VRPawn || !VRPawn->Controller) @@ -89,7 +89,7 @@ void UTurnComponent::OnBeginTurn(const FInputActionValue& Value) if (TurnValue.X != 0.f) { - if (UVirtualRealityUtilities::IsDesktopMode() && bApplyDesktopRotation) + if (URWTHVRUtilities::IsDesktopMode() && bApplyDesktopRotation) { VRPawn->AddControllerYawInput(TurnRateFactor * TurnValue.X); } @@ -101,7 +101,7 @@ void UTurnComponent::OnBeginTurn(const FInputActionValue& Value) if (TurnValue.Y != 0.f) { - if (UVirtualRealityUtilities::IsDesktopMode() && bApplyDesktopRotation) + if (URWTHVRUtilities::IsDesktopMode() && bApplyDesktopRotation) { VRPawn->AddControllerPitchInput(TurnRateFactor * -TurnValue.Y); } diff --git a/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp b/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp index 432489a807a8ca2912bfdbcf416ef0359a0e2c31..edd9b374621067f51a225db82313e43c29ab614e 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp @@ -13,7 +13,7 @@ #include "Pawn/ReplicatedCameraComponent.h" #include "Pawn/ReplicatedMotionControllerComponent.h" #include "Roles/LiveLinkTransformTypes.h" -#include "Utility/VirtualRealityUtilities.h" +#include "Utility/RWTHVRUtilities.h" AVirtualRealityPawn::AVirtualRealityPawn(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) @@ -42,7 +42,7 @@ void AVirtualRealityPawn::Tick(float DeltaSeconds) { Super::Tick(DeltaSeconds); - if (UVirtualRealityUtilities::IsDesktopMode() && IsLocallyControlled()) + if (URWTHVRUtilities::IsDesktopMode() && IsLocallyControlled()) { SetCameraOffset(); UpdateRightHandForDesktopInteraction(); @@ -64,7 +64,7 @@ void AVirtualRealityPawn::NotifyControllerChanged() if (IsLocallyControlled()) { // Only do this for the primary node or when we're running in standalone - if (UVirtualRealityUtilities::IsRoomMountedMode() && (UVirtualRealityUtilities::IsPrimaryNode() || + if (URWTHVRUtilities::IsRoomMountedMode() && (URWTHVRUtilities::IsPrimaryNode() || GetNetMode() == NM_Standalone)) { // If we are also the authority (standalone or listen server), directly attach it to us. @@ -105,14 +105,14 @@ void AVirtualRealityPawn::SetupPlayerInputComponent(UInputComponent* PlayerInput // Don't do anything with the type if it's been set to clustertype or anything. const bool bClusterType = Type == EPlayerType::nDisplayPrimary || Type == EPlayerType::nDisplaySecondary; - if (!bClusterType && UVirtualRealityUtilities::IsHeadMountedMode()) + if (!bClusterType && URWTHVRUtilities::IsHeadMountedMode()) { // Could be too early to call this RPC... State->RequestSetPlayerType(Type); } } - if (UVirtualRealityUtilities::IsDesktopMode()) + if (URWTHVRUtilities::IsDesktopMode()) { PlayerController->bShowMouseCursor = true; PlayerController->bEnableClickEvents = true; @@ -129,7 +129,7 @@ void AVirtualRealityPawn::SetupPlayerInputComponent(UInputComponent* PlayerInput void AVirtualRealityPawn::EvaluateLivelink() const { - if (UVirtualRealityUtilities::IsRoomMountedMode() && IsLocallyControlled()) + if (URWTHVRUtilities::IsRoomMountedMode() && IsLocallyControlled()) { if (bDisableLiveLink || HeadSubjectRepresentation.Subject.IsNone() || HeadSubjectRepresentation.Role == nullptr) { @@ -214,12 +214,12 @@ void AVirtualRealityPawn::SetupMotionControllerSources() FName MotionControllerSourceLeft = EName::None; FName MotionControllerSourceRight = EName::None; - if (UVirtualRealityUtilities::IsHeadMountedMode()) + if (URWTHVRUtilities::IsHeadMountedMode()) { MotionControllerSourceLeft = FName("Left"); MotionControllerSourceRight = FName("Right"); } - if (UVirtualRealityUtilities::IsRoomMountedMode()) + if (URWTHVRUtilities::IsRoomMountedMode()) { MotionControllerSourceLeft = LeftSubjectRepresentation.Subject; MotionControllerSourceRight = RightSubjectRepresentation.Subject; diff --git a/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp b/Source/RWTHVRToolkit/Private/Utility/RWTHVRUtilities.cpp similarity index 85% rename from Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp rename to Source/RWTHVRToolkit/Private/Utility/RWTHVRUtilities.cpp index 6d3afe606d4410a8cf5821cb8884d8e031c86153..dda023adab52f2bf450b4851be0376a9e47db7cc 100644 --- a/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp +++ b/Source/RWTHVRToolkit/Private/Utility/RWTHVRUtilities.cpp @@ -1,4 +1,4 @@ -#include "Utility/VirtualRealityUtilities.h" +#include "Utility/RWTHVRUtilities.h" #if PLATFORM_SUPPORTS_NDISPLAY #include "DisplayClusterConfigurationTypes.h" @@ -20,12 +20,12 @@ DEFINE_LOG_CATEGORY(Toolkit); -bool UVirtualRealityUtilities::IsDesktopMode() +bool URWTHVRUtilities::IsDesktopMode() { return !IsRoomMountedMode() && !IsHeadMountedMode(); } -bool UVirtualRealityUtilities::IsRoomMountedMode() +bool URWTHVRUtilities::IsRoomMountedMode() { #if PLATFORM_SUPPORTS_NDISPLAY return IDisplayCluster::Get().GetOperationMode() == EDisplayClusterOperationMode::Cluster; @@ -34,14 +34,14 @@ bool UVirtualRealityUtilities::IsRoomMountedMode() #endif } -bool UVirtualRealityUtilities::IsHeadMountedMode() +bool URWTHVRUtilities::IsHeadMountedMode() { // In editor builds: checks for EdEngine->IsVRPreviewActive() // In packaged builds: checks for `-vr` in commandline or bStartInVR in UGeneralProjectSettings return FAudioDevice::CanUseVRAudioDevice(); } -bool UVirtualRealityUtilities::IsCave() +bool URWTHVRUtilities::IsCave() { #if PLATFORM_SUPPORTS_NDISPLAY if (!IsRoomMountedMode()) @@ -55,7 +55,7 @@ bool UVirtualRealityUtilities::IsCave() #endif } -bool UVirtualRealityUtilities::IsRolv() +bool URWTHVRUtilities::IsRolv() { #if PLATFORM_SUPPORTS_NDISPLAY if (!IsRoomMountedMode()) @@ -70,7 +70,7 @@ bool UVirtualRealityUtilities::IsRolv() } /* Return true on the Primary in cluster mode and in a normal desktop session. Otherwise false */ -bool UVirtualRealityUtilities::IsPrimaryNode() +bool URWTHVRUtilities::IsPrimaryNode() { #if PLATFORM_SUPPORTS_NDISPLAY if (!IDisplayCluster::IsAvailable()) @@ -88,12 +88,12 @@ bool UVirtualRealityUtilities::IsPrimaryNode() #endif } -bool UVirtualRealityUtilities::IsSecondaryNode() +bool URWTHVRUtilities::IsSecondaryNode() { return !IsPrimaryNode(); } -FString UVirtualRealityUtilities::GetNodeName() +FString URWTHVRUtilities::GetNodeName() { #if PLATFORM_SUPPORTS_NDISPLAY return IsRoomMountedMode() ? IDisplayCluster::Get().GetClusterMgr()->GetNodeId() : FString(TEXT("Localhost")); @@ -102,7 +102,7 @@ FString UVirtualRealityUtilities::GetNodeName() #endif } -float UVirtualRealityUtilities::GetEyeDistance() +float URWTHVRUtilities::GetEyeDistance() { if (IsHeadMountedMode()) { @@ -119,7 +119,7 @@ float UVirtualRealityUtilities::GetEyeDistance() } } -EEyeStereoOffset UVirtualRealityUtilities::GetNodeEyeType() +EEyeStereoOffset URWTHVRUtilities::GetNodeEyeType() { #if PLATFORM_SUPPORTS_NDISPLAY const ADisplayClusterRootActor* RootActor = IDisplayCluster::Get().GetGameMgr()->GetRootActor(); @@ -131,7 +131,7 @@ EEyeStereoOffset UVirtualRealityUtilities::GetNodeEyeType() #endif } -USceneComponent* UVirtualRealityUtilities::GetClusterComponent(const FString& Name) +USceneComponent* URWTHVRUtilities::GetClusterComponent(const FString& Name) { #if PLATFORM_SUPPORTS_NDISPLAY const ADisplayClusterRootActor* RootActor = IDisplayCluster::Get().GetGameMgr()->GetRootActor(); @@ -141,7 +141,7 @@ USceneComponent* UVirtualRealityUtilities::GetClusterComponent(const FString& Na #endif } -USceneComponent* UVirtualRealityUtilities::GetNamedClusterComponent(const ENamedClusterComponent& Component) +USceneComponent* URWTHVRUtilities::GetNamedClusterComponent(const ENamedClusterComponent& Component) { switch (Component) { @@ -175,7 +175,7 @@ USceneComponent* UVirtualRealityUtilities::GetNamedClusterComponent(const ENamed } } -void UVirtualRealityUtilities::ShowErrorAndQuit(UWorld* WorldContext, const FString& Message) +void URWTHVRUtilities::ShowErrorAndQuit(UWorld* WorldContext, const FString& Message) { UE_LOG(Toolkit, Error, TEXT("%s"), *Message) #if WITH_EDITOR diff --git a/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h b/Source/RWTHVRToolkit/Public/Utility/RWTHVRUtilities.h similarity index 95% rename from Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h rename to Source/RWTHVRToolkit/Public/Utility/RWTHVRUtilities.h index a06509ff2367e389a2a830b2e7463ea220d15efb..e0f6d7e4e6adf0735007004cbfd9b5d0ae8064f8 100644 --- a/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h +++ b/Source/RWTHVRToolkit/Public/Utility/RWTHVRUtilities.h @@ -4,7 +4,7 @@ #include "Kismet/BlueprintFunctionLibrary.h" #include "UObject/ConstructorHelpers.h" -#include "VirtualRealityUtilities.generated.h" +#include "RWTHVRUtilities.generated.h" /** @@ -40,7 +40,7 @@ enum class EEyeStereoOffset }; UCLASS() -class RWTHVRTOOLKIT_API UVirtualRealityUtilities : public UBlueprintFunctionLibrary +class RWTHVRTOOLKIT_API URWTHVRUtilities : public UBlueprintFunctionLibrary { GENERATED_BODY()