diff --git a/Config/DefaultRWTHVRToolkit.ini b/Config/DefaultRWTHVRToolkit.ini index 1fa18ba2f268987d434816d472da165fe8486d48..e9585a9f68eb75f31e4e7455de23095ddf501da1 100644 --- a/Config/DefaultRWTHVRToolkit.ini +++ b/Config/DefaultRWTHVRToolkit.ini @@ -18,7 +18,9 @@ +FunctionRedirects = (OldName="/Script/RWTHVRToolkit.DirectInteractionComponent.OnBeginGrab",NewName="/Script/RWTHVRToolkit.DirectInteractionComponent.OnBeginInteraction") +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.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") \ No newline at end of file ++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") \ No newline at end of file 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/Input/Default_IMC/IMC_General.uasset b/Content/Input/Default_IMC/IMC_General.uasset index 89b1411e4650beb0d2d263244dd0a9e21e5e936b..86a5cc420d316fec6cfe82086febf9292630569a 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/Pawn/Navigation/TurnComponent.cpp b/Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp index 9388a11d61314e83624b5a173e831192f07c6b6e..7e3aee8e16027a8d7e55379c38ca4fe0bc2ac537 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp @@ -37,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); } } 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