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
No related branches found
No related tags found
2 merge requests!107UE5.4-2024.1-rc1,!91Interaction refactoring and replication
Pipeline #476682 failed
Showing
with 83 additions and 29 deletions
......@@ -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"
......
......@@ -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")
......
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
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
......
......@@ -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
......
......@@ -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);
......
......@@ -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();
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment