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

Merge branch 'dev/5.4' into refactor/interaction_replication

parents a48342ef f01b1ba9
Branches
Tags
2 merge requests!107UE5.4-2024.1-rc1,!91Interaction refactoring and replication
Pipeline #476682 failed
This commit is part of merge request !91. Comments created here will be created in the context of that merge request.
Showing
with 83 additions and 29 deletions
...@@ -42,7 +42,7 @@ include: ...@@ -42,7 +42,7 @@ include:
variables: variables:
UNREAL_VERSION: "5.4" UNREAL_VERSION: "5.4"
CUSTOM_NDISPLAY_CONFIG: "aixcave_5_3_dev.ndisplay" CUSTOM_NDISPLAY_CONFIG: "aixcave_5_4.ndisplay"
stages: stages:
- analyze - analyze
...@@ -83,7 +83,7 @@ Generate_Project: ...@@ -83,7 +83,7 @@ Generate_Project:
RUN_SETUP: "false" RUN_SETUP: "false"
GEN_DEPENDENCIES: "( GEN_DEPENDENCIES: "(
[master@UnrealDTrackPlugin]='https://github.com/VRGroupRWTH/UnrealDTrackPlugin.git' [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: Generate_Project_Without_Cluster:
...@@ -148,7 +148,7 @@ Build_Linux_Without_Cluster: ...@@ -148,7 +148,7 @@ Build_Linux_Without_Cluster:
artifacts: true artifacts: true
# Deploys to vrdev # Deploys to vrdev
Deploy_Windows: .Deploy_Windows:
rules: rules:
- if: $CI_PIPELINE_SOURCE == "web" - if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_PIPELINE_SOURCE == "schedule"
......
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
+FunctionRedirects = (OldName="/Script/RWTHVRToolkit.DirectInteractionComponent.OnEndGrab",NewName="/Script/RWTHVRToolkit.DirectInteractionComponent.OnEndInteraction") +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.PreviousGrabBehavioursInRange",NewName="/Script/RWTHVRToolkit.DirectInteractionComponent.PreviousInteractableComponentsInRange")
+PropertyRedirects = (OldName="/Script/RWTHVRToolkit.DirectInteractionComponent.CurrentGrabBehavioursInRange",NewName="/Script/RWTHVRToolkit.DirectInteractionComponent.CurrentInteractableComponentsInRange") +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.OnBeginInteraction",NewName="/Script/RWTHVRToolkit.UBaseInteractionComponent.OnBeginInteractionInputAction")
+FunctionRedirects=(OldName="/Script/RWTHVRToolkit.UBaseInteractionComponent.OnEndInteraction",NewName="/Script/RWTHVRToolkit.UBaseInteractionComponent.OnEndInteractionInputAction") +FunctionRedirects=(OldName="/Script/RWTHVRToolkit.UBaseInteractionComponent.OnEndInteraction",NewName="/Script/RWTHVRToolkit.UBaseInteractionComponent.OnEndInteractionInputAction")
+FunctionRedirects=(OldName="/Script/RWTHVRToolkit.UBaseInteractionComponent.MulticastHoverBehaviourStartRpc",NewName="/Script/RWTHVRToolkit.UBaseInteractionComponent.MulticastHoverBehaviourReplicationStartRpc") +FunctionRedirects=(OldName="/Script/RWTHVRToolkit.UBaseInteractionComponent.MulticastHoverBehaviourStartRpc",NewName="/Script/RWTHVRToolkit.UBaseInteractionComponent.MulticastHoverBehaviourReplicationStartRpc")
......
No preview for this file type
No preview for this file type
File deleted
File added
File added
No preview for this file type
File added
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -51,10 +51,20 @@ void URWTHVRWidgetInteractionComponent::SetupPlayerInput(UInputComponent* Player ...@@ -51,10 +51,20 @@ void URWTHVRWidgetInteractionComponent::SetupPlayerInput(UInputComponent* Player
return; return;
} }
EI->BindAction(WidgetClickInputAction, ETriggerEvent::Started, this, if (WidgetLeftClickInputAction)
&URWTHVRWidgetInteractionComponent::OnBeginClick); {
EI->BindAction(WidgetClickInputAction, ETriggerEvent::Completed, this, EI->BindAction(WidgetLeftClickInputAction, ETriggerEvent::Started, this,
&URWTHVRWidgetInteractionComponent::OnEndClick); &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 // Called every frame
...@@ -99,17 +109,29 @@ void URWTHVRWidgetInteractionComponent::SetInteractionRayVisibility(EInteraction ...@@ -99,17 +109,29 @@ void URWTHVRWidgetInteractionComponent::SetInteractionRayVisibility(EInteraction
} }
// Forward the click to the WidgetInteraction // Forward the click to the WidgetInteraction
void URWTHVRWidgetInteractionComponent::OnBeginClick(const FInputActionValue& Value) void URWTHVRWidgetInteractionComponent::OnBeginLeftClick(const FInputActionValue& Value)
{ {
PressPointerKey(EKeys::LeftMouseButton); PressPointerKey(EKeys::LeftMouseButton);
} }
// Forward the end click to the WidgetInteraction // Forward the end click to the WidgetInteraction
void URWTHVRWidgetInteractionComponent::OnEndClick(const FInputActionValue& Value) void URWTHVRWidgetInteractionComponent::OnEndLeftClick(const FInputActionValue& Value)
{ {
ReleasePointerKey(EKeys::LeftMouseButton); 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() void URWTHVRWidgetInteractionComponent::CreateInteractionRay()
{ {
// Only create a new static mesh component if we haven't gotten one already // Only create a new static mesh component if we haven't gotten one already
......
...@@ -50,13 +50,15 @@ void UCollisionHandlingMovement::TickComponent(float DeltaTime, enum ELevelTick ...@@ -50,13 +50,15 @@ void UCollisionHandlingMovement::TickComponent(float DeltaTime, enum ELevelTick
{ {
// you are only allowed to move horizontally in NAV_WALK // you are only allowed to move horizontally in NAV_WALK
// everything else will be handled by stepping-up/gravity // everything else will be handled by stepping-up/gravity
// so remove Z component for the input vector of the UFloatingPawnMovement // so rotate the input vector onto horizontal plane
InputVector.Z = 0.0f; const FRotator InputRot = FRotator(InputVector.Rotation());
const FRotator InputYaw = FRotator(0, InputRot.Yaw, 0);
InputVector = InputRot.UnrotateVector(InputVector);
InputVector = InputYaw.RotateVector(InputVector);
ConsumeInputVector(); ConsumeInputVector();
AddInputVector(InputVector); AddInputVector(InputVector);
} }
if (NavigationMode == EVRNavigationModes::NAV_FLY || NavigationMode == EVRNavigationModes::NAV_WALK) if (NavigationMode == EVRNavigationModes::NAV_FLY || NavigationMode == EVRNavigationModes::NAV_WALK)
{ {
// if me managed to get into a collision revert the movement since last Tick // if me managed to get into a collision revert the movement since last Tick
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "Pawn/Navigation/TurnComponent.h" #include "Pawn/Navigation/TurnComponent.h"
#include "EnhancedInputComponent.h" #include "EnhancedInputComponent.h"
#include "Camera/CameraComponent.h"
#include "Pawn/RWTHVRPawn.h" #include "Pawn/RWTHVRPawn.h"
#include "Utility/RWTHVRUtilities.h" #include "Utility/RWTHVRUtilities.h"
...@@ -35,23 +36,37 @@ void UTurnComponent::SetupPlayerInput(UInputComponent* PlayerInputComponent) ...@@ -35,23 +36,37 @@ void UTurnComponent::SetupPlayerInput(UInputComponent* PlayerInputComponent)
// turning // turning
if (bAllowTurning) if (bAllowTurning)
{
if (bSnapTurn)
{ {
// no snap turning for desktop mode // no snap turning for desktop mode
if (bSnapTurn && !URWTHVRUtilities::IsDesktopMode()) if (!URWTHVRUtilities::IsDesktopMode())
{ {
EI->BindAction(Turn, ETriggerEvent::Started, this, &UTurnComponent::OnBeginSnapTurn); EI->BindAction(XRTurn, ETriggerEvent::Started, this, &UTurnComponent::OnBeginSnapTurn);
} }
else else
{ {
EI->BindAction(Turn, ETriggerEvent::Triggered, this, &UTurnComponent::OnBeginTurn); EI->BindAction(DesktopTurn, ETriggerEvent::Triggered, this, &UTurnComponent::OnBeginTurn);
}
}
else
{
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 // bind additional functions for desktop rotations
if (URWTHVRUtilities::IsDesktopMode()) if (URWTHVRUtilities::IsDesktopMode())
{ {
EI->BindAction(DesktopRotation, ETriggerEvent::Started, this, &UTurnComponent::StartDesktopRotation); EI->BindAction(DesktopTurnCondition, ETriggerEvent::Started, this, &UTurnComponent::StartDesktopRotation);
EI->BindAction(DesktopRotation, ETriggerEvent::Completed, this, &UTurnComponent::EndDesktopRotation); EI->BindAction(DesktopTurnCondition, ETriggerEvent::Completed, this, &UTurnComponent::EndDesktopRotation);
} }
} }
...@@ -110,15 +125,14 @@ void UTurnComponent::OnBeginSnapTurn(const FInputActionValue& Value) ...@@ -110,15 +125,14 @@ void UTurnComponent::OnBeginSnapTurn(const FInputActionValue& Value)
void UTurnComponent::RotateCameraAndPawn(float Yaw) const void UTurnComponent::RotateCameraAndPawn(float Yaw) const
{ {
const FVector OrigLocation = VRPawn->GetActorLocation(); const FVector OrigLocation = VRPawn->HeadCameraComponent->GetComponentLocation();
FVector PivotPoint = VRPawn->GetActorTransform().InverseTransformPosition(OrigLocation);
PivotPoint.Z = 0.0f;
const FRotator OrigRotation = VRPawn->GetActorRotation(); const FRotator OrigRotation = VRPawn->GetActorRotation();
const FRotator NewRotation = FRotator(0, VRPawn->GetActorRotation().Yaw + Yaw, 0); 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->Controller->SetControlRotation(NewRotation);
VRPawn->SetActorLocationAndRotation(NewLocation, NewRotation); VRPawn->SetActorLocationAndRotation(NewLocation, NewRotation);
......
...@@ -44,14 +44,22 @@ public: ...@@ -44,14 +44,22 @@ public:
TEnumAsByte<EInteractionRayVisibility> InteractionRayVisibility = EInteractionRayVisibility::Invisible; TEnumAsByte<EInteractionRayVisibility> InteractionRayVisibility = EInteractionRayVisibility::Invisible;
UPROPERTY(EditAnywhere, Category = "Input") UPROPERTY(EditAnywhere, Category = "Input")
class UInputAction* WidgetClickInputAction; class UInputAction* WidgetLeftClickInputAction;
UPROPERTY(EditAnywhere, Category = "Input")
class UInputAction* WidgetRightClickInputAction;
private: private:
UFUNCTION() UFUNCTION()
void OnBeginClick(const FInputActionValue& Value); void OnBeginLeftClick(const FInputActionValue& Value);
UFUNCTION()
void OnEndLeftClick(const FInputActionValue& Value);
UFUNCTION()
void OnBeginRightClick(const FInputActionValue& Value);
UFUNCTION() UFUNCTION()
void OnEndClick(const FInputActionValue& Value); void OnEndRightClick(const FInputActionValue& Value);
void CreateInteractionRay(); void CreateInteractionRay();
void SetupInteractionRay(); void SetupInteractionRay();
......
...@@ -35,10 +35,13 @@ public: ...@@ -35,10 +35,13 @@ public:
float SnapTurnAngle = 22.5; float SnapTurnAngle = 22.5;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input|Actions") UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input|Actions")
class UInputAction* Turn; class UInputAction* XRTurn;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input|Actions") 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 * Called every tick as long as stick input is received to allow for continuous turning
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment