Skip to content
Snippets Groups Projects
Commit 3b500ecd authored by David Gilbert's avatar David Gilbert :bug:
Browse files

Merge branch 'dev/5.4' into '5.4'

UE5.4-2024.1-rc1

Closes #659

See merge request !107
parents 3da9a6a2 0b09ea2f
No related branches found
No related tags found
2 merge requests!111Backport 5.4 Zenodo ref change,!107UE5.4-2024.1-rc1
Pipeline #492045 passed
...@@ -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();
......
...@@ -2,16 +2,15 @@ ...@@ -2,16 +2,15 @@
#pragma once #pragma once
#include <Pawn/InputExtensionInterface.h>
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "UBaseInteractionComponent.h"
#include "Components/SceneComponent.h" #include "Components/SceneComponent.h"
#include "Interaction/Interactables/InteractableComponent.h" #include "Interaction/Interactables/InteractableComponent.h"
#include "RaycastInteractionComponent.generated.h" #include "RaycastInteractionComponent.generated.h"
UCLASS(Abstract, Blueprintable) UCLASS(Abstract, Blueprintable)
class RWTHVRTOOLKIT_API URaycastInteractionComponent : public USceneComponent, public IInputExtensionInterface class RWTHVRTOOLKIT_API URaycastInteractionComponent : public UUBaseInteractionComponent
{ {
GENERATED_BODY() GENERATED_BODY()
...@@ -23,20 +22,13 @@ public: ...@@ -23,20 +22,13 @@ public:
virtual void TickComponent(float DeltaTime, ELevelTick TickType, virtual void TickComponent(float DeltaTime, ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction) override; FActorComponentTickFunction* ThisTickFunction) override;
UPROPERTY(EditAnywhere, Category = "Input")
class UInputAction* InteractionInputAction;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Raycast") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Raycast")
float TraceLength = 3000.0; float TraceLength = 3000.0;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Raycast")
bool bShowDebugTrace = false;
private: private:
UFUNCTION() virtual void OnBeginInteractionInputAction(const FInputActionValue& Value) override;
void OnBeginInteraction(const FInputActionValue& Value);
UFUNCTION() virtual void OnEndInteractionInputAction(const FInputActionValue& Value) override;
void OnEndInteraction(const FInputActionValue& Value);
public: public:
virtual void SetupPlayerInput(UInputComponent* PlayerInputComponent) override; virtual void SetupPlayerInput(UInputComponent* PlayerInputComponent) override;
......
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/SceneComponent.h"
#include "Pawn/InputExtensionInterface.h"
#include "UBaseInteractionComponent.generated.h"
struct FInputActionValue;
enum EInteractionEventType : uint8;
class UActionBehaviour;
class UHoverBehaviour;
UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class RWTHVRTOOLKIT_API UUBaseInteractionComponent : public USceneComponent, public IInputExtensionInterface
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UUBaseInteractionComponent();
virtual void SetupPlayerInput(UInputComponent* PlayerInputComponent) override;
UPROPERTY(EditAnywhere, Category = "Input")
class UInputAction* InteractionInputAction;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Interaction")
TArray<AActor*> ActorsToIgnore;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Interaction")
bool bShowDebugTrace = false;
/*
* Replication part
*/
/**
* Requests the start of the replication process for the given HoverBehaviour, EventType and Hit.
* Depending on authority, this executes the replication of the behaviour directly or requests it via a server RPC.
*/
void RequestHoverBehaviourReplicationStart(UHoverBehaviour* Behaviour, const EInteractionEventType EventType,
const FHitResult& Hit);
/**
* This is executed on the server/authority. The behaviour is actually executed directly on the server, or
* multicast to all connected clients. The multicast then executes the behaviour.
*/
void HoverBehaviourReplicationStart(UHoverBehaviour* Behaviour, const EInteractionEventType EventType,
const FHitResult& Hit);
/**
* This is only executed on the local client which processed the interaction and requested the replication process
* to be started. Can be used e.g. for local effects or things that should be done both on the server and local
* client.
*/
void HoverBehaviourReplicationOriginatorCallback(UHoverBehaviour* Behaviour, const EInteractionEventType EventType,
const FHitResult& Hit);
/**
* Requests the start of the replication process for the given ActionBehaviour, EventType and the Value of the Input
* Action. Depending on authority, this executes the replication of the behaviour directly or requests it via a
* server RPC.
*/
void RequestActionBehaviourReplicationStart(UActionBehaviour* Behaviour, const EInteractionEventType EventType,
const FInputActionValue& Value);
/**
* This is executed on the server/authority. The behaviour is actually executed directly on the server, or
* multicast to all connected clients. The multicast then executes the behaviour.
*/
void ActionBehaviourReplicationStart(UActionBehaviour* Behaviour, const EInteractionEventType EventType,
const FInputActionValue& Value);
// RPCs
UFUNCTION(Server, Reliable)
void ServerRequestHoverBehaviourReplicationStartRpc(UHoverBehaviour* Behaviour,
const EInteractionEventType EventType, const FHitResult& Hit);
UFUNCTION(NetMulticast, Reliable)
void MulticastHoverBehaviourReplicationStartRpc(UHoverBehaviour* Behaviour, const EInteractionEventType EventType,
const FHitResult& Hit);
UFUNCTION(Server, Reliable)
void ServerRequestActionBehaviourReplicationStartRpc(UActionBehaviour* Behaviour,
const EInteractionEventType EventType,
const FInputActionValue& Value);
UFUNCTION(NetMulticast, Reliable)
void MulticastActionBehaviourReplicationStartRpc(UActionBehaviour* Behaviour, const EInteractionEventType EventType,
const FInputActionValue& Value);
private:
UFUNCTION()
virtual void OnBeginInteractionInputAction(const FInputActionValue& Value);
UFUNCTION()
virtual void OnEndInteractionInputAction(const FInputActionValue& Value);
};
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "ClusterRepresentationActor.generated.h"
class ARWTHVRPlayerState;
#if PLATFORM_SUPPORTS_CLUSTER
class ADisplayClusterRootActor;
#endif
UCLASS()
class RWTHVRTOOLKIT_API AClusterRepresentationActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AClusterRepresentationActor();
virtual void BeginPlay() override;
void AttachDCRAIfRequired(const ARWTHVRPlayerState* OptionalPlayerState = nullptr);
private:
bool bIsAttached = false;
#if PLATFORM_SUPPORTS_CLUSTER
bool AttachDCRA();
ADisplayClusterRootActor* SpawnDCRA();
#endif
};
...@@ -42,6 +42,12 @@ public: ...@@ -42,6 +42,12 @@ public:
void SetHeadComponent(USceneComponent* NewHeadComponent); void SetHeadComponent(USceneComponent* NewHeadComponent);
UFUNCTION(BlueprintCallable)
bool AddActorToIgnore(AActor* ActorToIgnore);
UFUNCTION(BlueprintCallable)
bool RemoveActorFromIgnore(AActor* ActorToIgnore);
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement")
EVRNavigationModes NavigationMode = EVRNavigationModes::NAV_WALK; EVRNavigationModes NavigationMode = EVRNavigationModes::NAV_WALK;
......
...@@ -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
......
...@@ -79,10 +79,6 @@ public: ...@@ -79,10 +79,6 @@ public:
UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "Pawn|LiveLink") UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "Pawn|LiveLink")
bool bWorldTransform = false; bool bWorldTransform = false;
/* The class which to search for DCRA attachment. TODO: Make this better it's ugly */
UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "Pawn|LiveLink")
TSubclassOf<AActor> CaveSetupActorClass;
protected: protected:
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override; virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
void AddInputMappingContext(const APlayerController* PC, const UInputMappingContext* Context) const; void AddInputMappingContext(const APlayerController* PC, const UInputMappingContext* Context) const;
...@@ -107,8 +103,8 @@ protected: ...@@ -107,8 +103,8 @@ protected:
UFUNCTION(Reliable, NetMulticast) UFUNCTION(Reliable, NetMulticast)
void MulticastAddDCSyncComponent(); void MulticastAddDCSyncComponent();
/* Attaches the DCRA to the pawn */ /* Attaches the Cluster representation to the pawn */
void AttachDCRAtoPawn(); void AttachClustertoPawn();
/* Set device specific motion controller sources (None, L/R, Livelink) */ /* Set device specific motion controller sources (None, L/R, Livelink) */
void SetupMotionControllerSources(); void SetupMotionControllerSources();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment