Skip to content
Snippets Groups Projects
Commit 7d71f6cd authored by Kris Tabea Helwig's avatar Kris Tabea Helwig
Browse files

Merge remote-tracking branch 'remotes/origin/dev/5.4' into fix/CAVESnapTurn

parents c211e5d7 4101dcd0
No related branches found
No related tags found
2 merge requests!107UE5.4-2024.1-rc1,!100Splits mouse rotation from IA_Turn to avoid snap turn on CAVE
Pipeline #463352 passed
......@@ -21,3 +21,6 @@
+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
No preview for this file type
No preview for this file type
File added
No preview for this file type
......@@ -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
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment