diff --git a/Content/BP_VirtualRealityPawn.uasset b/Content/BP_VirtualRealityPawn.uasset index 620662a93c39eef4b8dfb70f0ae04ef658718ad4..4c150048c03e3d2bd214195ab0b680a67ecba972 100644 Binary files a/Content/BP_VirtualRealityPawn.uasset and b/Content/BP_VirtualRealityPawn.uasset differ diff --git a/Content/Input/IMC_RWTH_Base.uasset b/Content/Input/IMC_RWTH_Base.uasset deleted file mode 100644 index afd983f600490f8005bfaa52a83a128d9a90bfcb..0000000000000000000000000000000000000000 Binary files a/Content/Input/IMC_RWTH_Base.uasset and /dev/null differ diff --git a/Content/Input/InputActions/IA_Fire.uasset b/Content/Input/InputActions/IA_Fire.uasset deleted file mode 100644 index aefe36aa0a33175490fbaf9b0b3a07ec2944a358..0000000000000000000000000000000000000000 Binary files a/Content/Input/InputActions/IA_Fire.uasset and /dev/null differ diff --git a/Content/Input/InputActions/IA_ToggleNavigationMode.uasset b/Content/Input/InputActions/IA_ToggleNavigationMode.uasset deleted file mode 100644 index edb012b251929f87776c2185c72a9cc33f110d07..0000000000000000000000000000000000000000 Binary files a/Content/Input/InputActions/IA_ToggleNavigationMode.uasset and /dev/null differ diff --git a/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp b/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp index a241f53678887fa98df8f4d71400e1b6a4cf2871..5d52b65f05e21211e2fd647101813d1b5b6bd78b 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp @@ -4,8 +4,6 @@ #include "Engine/LocalPlayer.h" #include "GameFramework/PlayerController.h" -#include "EnhancedInputComponent.h" -#include "EnhancedInputSubsystems.h" #include "ILiveLinkClient.h" #include "Core/RWTHVRPlayerState.h" #include "Kismet/GameplayStatics.h" @@ -14,7 +12,6 @@ #include "Pawn/Navigation/VRPawnMovement.h" #include "Pawn/ReplicatedCameraComponent.h" #include "Pawn/ReplicatedMotionControllerComponent.h" -#include "Pawn/VRPawnInputConfig.h" #include "Roles/LiveLinkTransformTypes.h" #include "Utility/VirtualRealityUtilities.h" @@ -100,16 +97,6 @@ void AVirtualRealityPawn::SetupPlayerInputComponent(UInputComponent* PlayerInput // There is probably a checkbox or way of spawning that prevents that in a better way that this, change if found. PlayerController->SetControlRotation(FRotator::ZeroRotator); - const ULocalPlayer* LP = PlayerController->GetLocalPlayer(); - UEnhancedInputLocalPlayerSubsystem* InputSubsystem = LP - ? LP->GetSubsystem<UEnhancedInputLocalPlayerSubsystem>() - : nullptr; - if (!InputSubsystem) - { - UE_LOG(Toolkit, Error, TEXT("[VirtualRealiytPawn.cpp] InputSubsystem IS NOT VALID")); - return; - } - SetupMotionControllerSources(); // Should not do this here but on connection or on possess I think. @@ -134,20 +121,7 @@ void AVirtualRealityPawn::SetupPlayerInputComponent(UInputComponent* PlayerInput PlayerController->bEnableClickEvents = true; PlayerController->bEnableMouseOverEvents = true; } - - InputSubsystem->ClearAllMappings(); - - // add Input Mapping context - InputSubsystem->AddMappingContext(IMCBase, 0); - - UEnhancedInputComponent* EI = Cast<UEnhancedInputComponent>(PlayerInputComponent); - - // old function bindings for grabbing and releasing - EI->BindAction(Fire, ETriggerEvent::Started, this, &AVirtualRealityPawn::OnBeginFire); - EI->BindAction(Fire, ETriggerEvent::Completed, this, &AVirtualRealityPawn::OnEndFire); - - EI->BindAction(ToggleNavigationMode, ETriggerEvent::Started, this, &AVirtualRealityPawn::OnToggleNavigationMode); - + // Set up mappings on input extension components, need to do this nicely for (UActorComponent* Comp : GetComponentsByInterface(UInputExtensionInterface::StaticClass())) @@ -274,44 +248,6 @@ void AVirtualRealityPawn::SetCameraOffset() const HeadCameraComponent->SetWorldLocationAndRotation(Location, Rotation); } -// legacy grabbing -void AVirtualRealityPawn::OnBeginFire(const FInputActionValue& Value) -{ - UE_LOG(LogTemp, Warning, TEXT("BeginFire")); - BasicVRInteraction->BeginInteraction(); -} - -// legacy grabbing -void AVirtualRealityPawn::OnEndFire(const FInputActionValue& Value) -{ - UE_LOG(Toolkit, Log, TEXT("EndFire")); - BasicVRInteraction->EndInteraction(); -} - -void AVirtualRealityPawn::OnToggleNavigationMode(const FInputActionValue& Value) -{ - switch (PawnMovement->NavigationMode) - { - case EVRNavigationModes::NAV_FLY: - PawnMovement->NavigationMode = EVRNavigationModes::NAV_WALK; - UE_LOG(Toolkit, Log, TEXT("Changed Nav mode to WALK")); - break; - - case EVRNavigationModes::NAV_WALK: - PawnMovement->NavigationMode = EVRNavigationModes::NAV_GHOST; - UE_LOG(Toolkit, Log, TEXT("Changed Nav mode to GHOST")); - break; - case EVRNavigationModes::NAV_GHOST: - PawnMovement->NavigationMode = EVRNavigationModes::NAV_FLY; - UE_LOG(Toolkit, Log, TEXT("Changed Nav mode to FLY")); - break; - default: - PawnMovement->NavigationMode = EVRNavigationModes::NAV_WALK; - UE_LOG(Toolkit, Log, TEXT("Changed Nav mode to WALK")); - break; - } -} - void AVirtualRealityPawn::ApplyLiveLinkTransform(const FTransform& Transform, const FLiveLinkTransformStaticData& StaticData) const { diff --git a/Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h b/Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h index 4d057835592305af944b398f790b84394d7d7f24..5bc5dbc2bb16d65965ee84a452d2d820fc843613 100644 --- a/Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h +++ b/Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h @@ -88,26 +88,6 @@ protected: /* Helper function that applies the LiveLink data to this component. Taken from the LiveLink Transform Controller. */ void ApplyLiveLinkTransform(const FTransform& Transform, const FLiveLinkTransformStaticData& StaticData) const; - /* Interaction */ - UFUNCTION(BlueprintCallable, Category = "Pawn|Interaction") - void OnBeginFire(const FInputActionValue& Value); - - UFUNCTION(BlueprintCallable, Category = "Pawn|Interaction") - void OnEndFire(const FInputActionValue& Value); - - UFUNCTION(BlueprintCallable) - void OnToggleNavigationMode(const FInputActionValue& Value); - - /* Input */ - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Pawn|Input") - UInputMappingContext* IMCBase; - - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Pawn|Input") - UInputAction* Fire; - - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Pawn|Input") - UInputAction* ToggleNavigationMode; - /* Fixes camera rotation in desktop mode. */ void SetCameraOffset() const; void UpdateRightHandForDesktopInteraction() const;