diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20ea821a08c9275202be6750bcc45bab43f99419..f4e4ba17ddd383711fd91ff1b742b0ba2a051642 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,7 +42,7 @@ include: variables: UNREAL_VERSION: "5.4" - CUSTOM_NDISPLAY_CONFIG: "aixcave_5_3_dev.ndisplay" + CUSTOM_NDISPLAY_CONFIG: "aixcave_5_4.ndisplay" stages: - analyze @@ -83,7 +83,7 @@ Generate_Project: RUN_SETUP: "false" GEN_DEPENDENCIES: "( [master@UnrealDTrackPlugin]='https://github.com/VRGroupRWTH/UnrealDTrackPlugin.git' - [dev/5.3@RWTHVRCluster]='https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-cluster-plugin.git' + [5.4@RWTHVRCluster]='https://git-ce.rwth-aachen.de/vr-vis/VR-Group/unreal-development/plugins/rwth-vr-cluster-plugin.git' )" Generate_Project_Without_Cluster: @@ -148,7 +148,7 @@ Build_Linux_Without_Cluster: artifacts: true # Deploys to vrdev -Deploy_Windows: +.Deploy_Windows: rules: - if: $CI_PIPELINE_SOURCE == "web" - if: $CI_PIPELINE_SOURCE == "schedule" diff --git a/Config/DefaultRWTHVRToolkit.ini b/Config/DefaultRWTHVRToolkit.ini index 50643d31a5dd9100fd5e107efa705fae6d70c639..5e0f330705848d2342828dce06c75fa670d760d4 100644 --- a/Config/DefaultRWTHVRToolkit.ini +++ b/Config/DefaultRWTHVRToolkit.ini @@ -19,6 +19,11 @@ +FunctionRedirects = (OldName="/Script/RWTHVRToolkit.DirectInteractionComponent.OnEndGrab",NewName="/Script/RWTHVRToolkit.DirectInteractionComponent.OnEndInteraction") +PropertyRedirects = (OldName="/Script/RWTHVRToolkit.DirectInteractionComponent.PreviousGrabBehavioursInRange",NewName="/Script/RWTHVRToolkit.DirectInteractionComponent.PreviousInteractableComponentsInRange") +PropertyRedirects = (OldName="/Script/RWTHVRToolkit.DirectInteractionComponent.CurrentGrabBehavioursInRange",NewName="/Script/RWTHVRToolkit.DirectInteractionComponent.CurrentInteractableComponentsInRange") ++PropertyRedirects = (OldName="/Script/RWTHVRToolkit.TurnComponent.DesktopRotation",NewName="/Script/RWTHVRToolkit.TurnComponent.DesktopTurnCondition") ++PropertyRedirects = (OldName="/Script/RWTHVRToolkit.TurnComponent.Turn",NewName="/Script/RWTHVRToolkit.TurnComponent.XRTurn") ++PropertyRedirects = (OldName="/Script/RWTHVRToolkit.RWTHVRWidgetInteractionComponent.WidgetClickInputAction",NewName="/Script/RWTHVRToolkit.RWTHVRWidgetInteractionComponent.WidgetLeftClickInputAction") ++FunctionRedirects = (OldName="/Script/RWTHVRToolkit.RWTHVRWidgetInteractionComponent.OnBeginClick",NewName="/Script/RWTHVRToolkit.RWTHVRWidgetInteractionComponent.OnBeginLeftClick") ++FunctionRedirects = (OldName="/Script/RWTHVRToolkit.RWTHVRWidgetInteractionComponent.OnEndClick",NewName="/Script/RWTHVRToolkit.RWTHVRWidgetInteractionComponent.OnEndLeftClick") +FunctionRedirects=(OldName="/Script/RWTHVRToolkit.UBaseInteractionComponent.OnBeginInteraction",NewName="/Script/RWTHVRToolkit.UBaseInteractionComponent.OnBeginInteractionInputAction") +FunctionRedirects=(OldName="/Script/RWTHVRToolkit.UBaseInteractionComponent.OnEndInteraction",NewName="/Script/RWTHVRToolkit.UBaseInteractionComponent.OnEndInteractionInputAction") +FunctionRedirects=(OldName="/Script/RWTHVRToolkit.UBaseInteractionComponent.MulticastHoverBehaviourStartRpc",NewName="/Script/RWTHVRToolkit.UBaseInteractionComponent.MulticastHoverBehaviourReplicationStartRpc") diff --git a/Content/BP_RWTHVRGameModeBase.uasset b/Content/BP_RWTHVRGameModeBase.uasset index a073a7f7cc247654e724c9d348d57f9bdc55d9ed..3bfda91bae7068c7283ece3e8bbe26477c25bd90 100644 Binary files a/Content/BP_RWTHVRGameModeBase.uasset and b/Content/BP_RWTHVRGameModeBase.uasset differ diff --git a/Content/Components/Movement/Turn/BP_TurnComponent.uasset b/Content/Components/Movement/Turn/BP_TurnComponent.uasset index a572594744827a04a0a6a6b1912e80ef9be86297..d45f880d4277580f76c4fc943d97c35c7a3d0386 100644 Binary files a/Content/Components/Movement/Turn/BP_TurnComponent.uasset and b/Content/Components/Movement/Turn/BP_TurnComponent.uasset differ diff --git a/Content/Components/Movement/Turn/IA_DesktopRotation.uasset b/Content/Components/Movement/Turn/IA_DesktopRotation.uasset deleted file mode 100644 index 9a780d7a9679fdf2a68a1fca575200140e057a73..0000000000000000000000000000000000000000 Binary files a/Content/Components/Movement/Turn/IA_DesktopRotation.uasset and /dev/null differ diff --git a/Content/Components/Movement/Turn/IA_DesktopTurn.uasset b/Content/Components/Movement/Turn/IA_DesktopTurn.uasset new file mode 100644 index 0000000000000000000000000000000000000000..db8e3f16401d6456abf4e8d1476bde839e8c39b1 Binary files /dev/null and b/Content/Components/Movement/Turn/IA_DesktopTurn.uasset differ diff --git a/Content/Components/Movement/Turn/IA_DesktopTurnCondition.uasset b/Content/Components/Movement/Turn/IA_DesktopTurnCondition.uasset new file mode 100644 index 0000000000000000000000000000000000000000..bdf5a71cce576dd790298eb478b217e6968d2739 Binary files /dev/null and b/Content/Components/Movement/Turn/IA_DesktopTurnCondition.uasset differ diff --git a/Content/Components/WidgetInteraction/BP_RWTHVRWidgetInteractionComponent.uasset b/Content/Components/WidgetInteraction/BP_RWTHVRWidgetInteractionComponent.uasset index 904f5d3363442da0ff916b54041f595a4e023ffc..f6f9bafd520036d434be5501aade85a17a8a6f7a 100644 Binary files a/Content/Components/WidgetInteraction/BP_RWTHVRWidgetInteractionComponent.uasset and b/Content/Components/WidgetInteraction/BP_RWTHVRWidgetInteractionComponent.uasset differ diff --git a/Content/Components/WidgetInteraction/IA_WidgetClick.uasset b/Content/Components/WidgetInteraction/IA_WidgetClick.uasset deleted file mode 100644 index 470e02e6edeec5b128dd66f602fc5680e3fb9dbe..0000000000000000000000000000000000000000 Binary files a/Content/Components/WidgetInteraction/IA_WidgetClick.uasset and /dev/null differ diff --git a/Content/Components/WidgetInteraction/IA_WidgetLeftClick.uasset b/Content/Components/WidgetInteraction/IA_WidgetLeftClick.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c3e97377bcc821f4ea99df5a92b44594c710564f Binary files /dev/null and b/Content/Components/WidgetInteraction/IA_WidgetLeftClick.uasset differ diff --git a/Content/Components/WidgetInteraction/IA_WidgetRightClick.uasset b/Content/Components/WidgetInteraction/IA_WidgetRightClick.uasset new file mode 100644 index 0000000000000000000000000000000000000000..320bf66bc73fa8714baae5258c680aba5f20261a Binary files /dev/null and b/Content/Components/WidgetInteraction/IA_WidgetRightClick.uasset differ diff --git a/Content/Input/Default_IMC/IMC_General.uasset b/Content/Input/Default_IMC/IMC_General.uasset index 3456d8201d9f1850ddc3bd22eb86f7e331fbbe00..bfc100b8d7b66753e20343576c91f76dc51cfaac 100644 Binary files a/Content/Input/Default_IMC/IMC_General.uasset and b/Content/Input/Default_IMC/IMC_General.uasset differ diff --git a/Content/Input/Default_IMC/IMC_MovementLeftHand.uasset b/Content/Input/Default_IMC/IMC_MovementLeftHand.uasset index 61a3048f2f7d7470bcc88dd398b06a5cbd825939..0aed5008caf02d89df79d46b4267a447a5e0d9cb 100644 Binary files a/Content/Input/Default_IMC/IMC_MovementLeftHand.uasset and b/Content/Input/Default_IMC/IMC_MovementLeftHand.uasset differ diff --git a/Content/Input/Default_IMC/IMC_MovementRightHand.uasset b/Content/Input/Default_IMC/IMC_MovementRightHand.uasset index fd7e3cd5dd01591ed98c06be64b54ca17221f8c0..153723ca229bab41ed167983d4751d2d7312a5d6 100644 Binary files a/Content/Input/Default_IMC/IMC_MovementRightHand.uasset and b/Content/Input/Default_IMC/IMC_MovementRightHand.uasset differ diff --git a/Source/RWTHVRToolkit/Private/Interaction/Interactors/RWTHVRWidgetInteractionComponent.cpp b/Source/RWTHVRToolkit/Private/Interaction/Interactors/RWTHVRWidgetInteractionComponent.cpp index 3a87de65d2cb52a5bce0dd0aa71af9dd3b2f69bb..23e0727a0f17734282db4c1f0051965789b938ca 100644 --- a/Source/RWTHVRToolkit/Private/Interaction/Interactors/RWTHVRWidgetInteractionComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Interaction/Interactors/RWTHVRWidgetInteractionComponent.cpp @@ -51,10 +51,20 @@ void URWTHVRWidgetInteractionComponent::SetupPlayerInput(UInputComponent* Player return; } - EI->BindAction(WidgetClickInputAction, ETriggerEvent::Started, this, - &URWTHVRWidgetInteractionComponent::OnBeginClick); - EI->BindAction(WidgetClickInputAction, ETriggerEvent::Completed, this, - &URWTHVRWidgetInteractionComponent::OnEndClick); + if (WidgetLeftClickInputAction) + { + EI->BindAction(WidgetLeftClickInputAction, ETriggerEvent::Started, this, + &URWTHVRWidgetInteractionComponent::OnBeginLeftClick); + EI->BindAction(WidgetLeftClickInputAction, ETriggerEvent::Completed, this, + &URWTHVRWidgetInteractionComponent::OnEndLeftClick); + } + if (WidgetRightClickInputAction) + { + EI->BindAction(WidgetRightClickInputAction, ETriggerEvent::Started, this, + &URWTHVRWidgetInteractionComponent::OnBeginRightClick); + EI->BindAction(WidgetRightClickInputAction, ETriggerEvent::Completed, this, + &URWTHVRWidgetInteractionComponent::OnEndRightClick); + } } // Called every frame @@ -99,17 +109,29 @@ void URWTHVRWidgetInteractionComponent::SetInteractionRayVisibility(EInteraction } // Forward the click to the WidgetInteraction -void URWTHVRWidgetInteractionComponent::OnBeginClick(const FInputActionValue& Value) +void URWTHVRWidgetInteractionComponent::OnBeginLeftClick(const FInputActionValue& Value) { PressPointerKey(EKeys::LeftMouseButton); } // Forward the end click to the WidgetInteraction -void URWTHVRWidgetInteractionComponent::OnEndClick(const FInputActionValue& Value) +void URWTHVRWidgetInteractionComponent::OnEndLeftClick(const FInputActionValue& Value) { ReleasePointerKey(EKeys::LeftMouseButton); } +// Forward the click to the WidgetInteraction +void URWTHVRWidgetInteractionComponent::OnBeginRightClick(const FInputActionValue& Value) +{ + PressPointerKey(EKeys::RightMouseButton); +} + +// Forward the end click to the WidgetInteraction +void URWTHVRWidgetInteractionComponent::OnEndRightClick(const FInputActionValue& Value) +{ + ReleasePointerKey(EKeys::RightMouseButton); +} + void URWTHVRWidgetInteractionComponent::CreateInteractionRay() { // Only create a new static mesh component if we haven't gotten one already diff --git a/Source/RWTHVRToolkit/Private/Pawn/Navigation/CollisionHandlingMovement.cpp b/Source/RWTHVRToolkit/Private/Pawn/Navigation/CollisionHandlingMovement.cpp index de761095cc544cdbcb4f084120b1e3e0961fe0f9..f12fcd89ba03d0c570b099d9a8fc5a6747246f74 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/Navigation/CollisionHandlingMovement.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/Navigation/CollisionHandlingMovement.cpp @@ -50,13 +50,15 @@ void UCollisionHandlingMovement::TickComponent(float DeltaTime, enum ELevelTick { // you are only allowed to move horizontally in NAV_WALK // everything else will be handled by stepping-up/gravity - // so remove Z component for the input vector of the UFloatingPawnMovement - InputVector.Z = 0.0f; + // so rotate the input vector onto horizontal plane + const FRotator InputRot = FRotator(InputVector.Rotation()); + const FRotator InputYaw = FRotator(0, InputRot.Yaw, 0); + InputVector = InputRot.UnrotateVector(InputVector); + InputVector = InputYaw.RotateVector(InputVector); ConsumeInputVector(); AddInputVector(InputVector); } - - + if (NavigationMode == EVRNavigationModes::NAV_FLY || NavigationMode == EVRNavigationModes::NAV_WALK) { // if me managed to get into a collision revert the movement since last Tick diff --git a/Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp b/Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp index bcf78e6bd57870bc4e3aef0bbeccb3b730aa0f0e..7e3aee8e16027a8d7e55379c38ca4fe0bc2ac537 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp @@ -4,6 +4,7 @@ #include "Pawn/Navigation/TurnComponent.h" #include "EnhancedInputComponent.h" +#include "Camera/CameraComponent.h" #include "Pawn/RWTHVRPawn.h" #include "Utility/RWTHVRUtilities.h" @@ -36,22 +37,36 @@ void UTurnComponent::SetupPlayerInput(UInputComponent* PlayerInputComponent) // turning if (bAllowTurning) { - // no snap turning for desktop mode - if (bSnapTurn && !URWTHVRUtilities::IsDesktopMode()) + if (bSnapTurn) { - EI->BindAction(Turn, ETriggerEvent::Started, this, &UTurnComponent::OnBeginSnapTurn); + // no snap turning for desktop mode + if (!URWTHVRUtilities::IsDesktopMode()) + { + EI->BindAction(XRTurn, ETriggerEvent::Started, this, &UTurnComponent::OnBeginSnapTurn); + } + else + { + EI->BindAction(DesktopTurn, ETriggerEvent::Triggered, this, &UTurnComponent::OnBeginTurn); + } } else { - EI->BindAction(Turn, ETriggerEvent::Triggered, this, &UTurnComponent::OnBeginTurn); + if (!URWTHVRUtilities::IsDesktopMode()) + { + EI->BindAction(XRTurn, ETriggerEvent::Triggered, this, &UTurnComponent::OnBeginTurn); + } + else + { + EI->BindAction(DesktopTurn, ETriggerEvent::Triggered, this, &UTurnComponent::OnBeginTurn); + } } } // bind additional functions for desktop rotations if (URWTHVRUtilities::IsDesktopMode()) { - EI->BindAction(DesktopRotation, ETriggerEvent::Started, this, &UTurnComponent::StartDesktopRotation); - EI->BindAction(DesktopRotation, ETriggerEvent::Completed, this, &UTurnComponent::EndDesktopRotation); + EI->BindAction(DesktopTurnCondition, ETriggerEvent::Started, this, &UTurnComponent::StartDesktopRotation); + EI->BindAction(DesktopTurnCondition, ETriggerEvent::Completed, this, &UTurnComponent::EndDesktopRotation); } } @@ -110,15 +125,14 @@ void UTurnComponent::OnBeginSnapTurn(const FInputActionValue& Value) void UTurnComponent::RotateCameraAndPawn(float Yaw) const { - const FVector OrigLocation = VRPawn->GetActorLocation(); - FVector PivotPoint = VRPawn->GetActorTransform().InverseTransformPosition(OrigLocation); - PivotPoint.Z = 0.0f; + const FVector OrigLocation = VRPawn->HeadCameraComponent->GetComponentLocation(); const FRotator OrigRotation = VRPawn->GetActorRotation(); - const FRotator NewRotation = FRotator(0, VRPawn->GetActorRotation().Yaw + Yaw, 0); - const FVector NewLocation = OrigLocation + OrigRotation.RotateVector(PivotPoint); + const FVector Offset = VRPawn->GetActorLocation() - OrigLocation; + const FVector UntwistedOffset = OrigRotation.GetInverse().RotateVector(Offset); + const FVector NewLocation = OrigLocation + NewRotation.RotateVector(UntwistedOffset); VRPawn->Controller->SetControlRotation(NewRotation); VRPawn->SetActorLocationAndRotation(NewLocation, NewRotation); diff --git a/Source/RWTHVRToolkit/Public/Interaction/Interactors/RWTHVRWidgetInteractionComponent.h b/Source/RWTHVRToolkit/Public/Interaction/Interactors/RWTHVRWidgetInteractionComponent.h index 4b1139cf89724faea664f4ac4e2e42f9cf1bb9db..34770d50d324a6f2e311f898636aefc1610a5140 100644 --- a/Source/RWTHVRToolkit/Public/Interaction/Interactors/RWTHVRWidgetInteractionComponent.h +++ b/Source/RWTHVRToolkit/Public/Interaction/Interactors/RWTHVRWidgetInteractionComponent.h @@ -44,14 +44,22 @@ public: TEnumAsByte<EInteractionRayVisibility> InteractionRayVisibility = EInteractionRayVisibility::Invisible; UPROPERTY(EditAnywhere, Category = "Input") - class UInputAction* WidgetClickInputAction; + class UInputAction* WidgetLeftClickInputAction; + UPROPERTY(EditAnywhere, Category = "Input") + class UInputAction* WidgetRightClickInputAction; private: UFUNCTION() - void OnBeginClick(const FInputActionValue& Value); + void OnBeginLeftClick(const FInputActionValue& Value); + + UFUNCTION() + void OnEndLeftClick(const FInputActionValue& Value); + + UFUNCTION() + void OnBeginRightClick(const FInputActionValue& Value); UFUNCTION() - void OnEndClick(const FInputActionValue& Value); + void OnEndRightClick(const FInputActionValue& Value); void CreateInteractionRay(); void SetupInteractionRay(); diff --git a/Source/RWTHVRToolkit/Public/Pawn/Navigation/TurnComponent.h b/Source/RWTHVRToolkit/Public/Pawn/Navigation/TurnComponent.h index 96de1a8b08b770ad7716839aae2ce138dee93321..72cbaf558d17f75beea4826690f05324b802b8bf 100644 --- a/Source/RWTHVRToolkit/Public/Pawn/Navigation/TurnComponent.h +++ b/Source/RWTHVRToolkit/Public/Pawn/Navigation/TurnComponent.h @@ -35,10 +35,13 @@ public: float SnapTurnAngle = 22.5; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input|Actions") - class UInputAction* Turn; + class UInputAction* XRTurn; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input|Actions") - class UInputAction* DesktopRotation; + class UInputAction* DesktopTurn; + + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input|Actions") + class UInputAction* DesktopTurnCondition; /** * Called every tick as long as stick input is received to allow for continuous turning