diff --git a/Content/BP_VirtualRealityPawn.uasset b/Content/BP_VirtualRealityPawn.uasset index 430b5fcb59c2de5830da091042ccc4f06cc76d45..57db298b94dd29a724a4621be5985db121929de2 100644 Binary files a/Content/BP_VirtualRealityPawn.uasset and b/Content/BP_VirtualRealityPawn.uasset differ diff --git a/Content/RWTHVRGameMode.uasset b/Content/RWTHVRGameMode.uasset index 6e3b11f843990e7dd4f9418596c8987874829aa1..6653bd71a4322c9dcbc3ea7233778864a82def5a 100644 Binary files a/Content/RWTHVRGameMode.uasset and b/Content/RWTHVRGameMode.uasset differ diff --git a/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp b/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp index 324da1efed37f74ea74239577279b479bc192854..0cdd604a8af4c2fb856b490a63b3f0d4e1d175e7 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp @@ -27,31 +27,22 @@ AVirtualRealityPawn::AVirtualRealityPawn(const FObjectInitializer& ObjectInitial CameraComponent->SetupAttachment(RootComponent); CameraComponent->SetRelativeLocation(FVector(0.0f, 0.0f, BaseEyeHeight)); //so it is rendered correctly in editor - Head = CreateDefaultSubobject<UUniversalTrackedComponent>(TEXT("Head")); - Head->ProxyType = ETrackedComponentType::TCT_HEAD; - Head->SetupAttachment(RootComponent); - - CapsuleRotationFix = CreateDefaultSubobject<USceneComponent>(TEXT("CapsuleRotationFix")); - CapsuleRotationFix->SetUsingAbsoluteRotation(true); - CapsuleRotationFix->SetupAttachment(Head); - + Head = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("Head MCC")); + Head->SetRelativeLocation(FVector(0.0f, 0.0f, 0.0f)); + Head->SetupAttachment(CameraComponent); + PawnMovement = CreateDefaultSubobject<UVRPawnMovement>(TEXT("Pawn Movement")); PawnMovement->SetUpdatedComponent(RootComponent); - PawnMovement->SetHeadComponent(CapsuleRotationFix); + PawnMovement->SetHeadComponent(Head); - RightHand = CreateDefaultSubobject<UUniversalTrackedComponent>(TEXT("Right Hand")); - RightHand->ProxyType = ETrackedComponentType::TCT_RIGHT_HAND; - RightHand->AttachementType = EAttachementType::AT_FLYSTICK; + RightHand = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("Right Hand MCC")); RightHand->SetupAttachment(RootComponent); - LeftHand = CreateDefaultSubobject<UUniversalTrackedComponent>(TEXT("Left Hand")); - LeftHand->ProxyType = ETrackedComponentType::TCT_LEFT_HAND; - LeftHand->AttachementType = EAttachementType::AT_HANDTARGET; + LeftHand = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("Left Hand MCC")); LeftHand->SetupAttachment(RootComponent); BasicVRInteraction = CreateDefaultSubobject<UBasicVRInteractionComponent>(TEXT("Basic VR Interaction")); - BasicVRInteraction->Initialize(RightHand); - + BasicVRInteraction->Initialize(RightHand); } void AVirtualRealityPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) @@ -74,8 +65,7 @@ void AVirtualRealityPawn::SetupPlayerInputComponent(UInputComponent* PlayerInput EI->BindAction(Fire, ETriggerEvent::Started, this, &AVirtualRealityPawn::OnBeginFire); EI->BindAction(Fire, ETriggerEvent::Completed, this, &AVirtualRealityPawn::OnEndFire); - EI->BindAction(ToggleNavigationMode,ETriggerEvent::Started,this,&AVirtualRealityPawn::OnToggleNavigationMode); - + EI->BindAction(ToggleNavigationMode,ETriggerEvent::Started,this,&AVirtualRealityPawn::OnToggleNavigationMode); } // legacy grabbing diff --git a/Source/RWTHVRToolkit/Public/Pawn/ContinuousMovementComponent.h b/Source/RWTHVRToolkit/Public/Pawn/ContinuousMovementComponent.h index 38bada0c11d392d7e011b4d9d2830c3399197bf2..625196dd99a321d1169d90bf0826de4f3d8b78f1 100644 --- a/Source/RWTHVRToolkit/Public/Pawn/ContinuousMovementComponent.h +++ b/Source/RWTHVRToolkit/Public/Pawn/ContinuousMovementComponent.h @@ -89,10 +89,10 @@ public: private: UPROPERTY() - UUniversalTrackedComponent* MovementHand; + UMotionControllerComponent* MovementHand; UPROPERTY() - UUniversalTrackedComponent* RotationHand; + UMotionControllerComponent* RotationHand; UPROPERTY() class UInputMappingContext* IMCMovement; diff --git a/Source/RWTHVRToolkit/Public/Pawn/TeleportationComponent.h b/Source/RWTHVRToolkit/Public/Pawn/TeleportationComponent.h index 4521fdd7322e5880f533d674b73ee992ffbf926e..003f6a96f01ca828e2da9f1cde509a01a913d194 100644 --- a/Source/RWTHVRToolkit/Public/Pawn/TeleportationComponent.h +++ b/Source/RWTHVRToolkit/Public/Pawn/TeleportationComponent.h @@ -117,10 +117,10 @@ public: private: UPROPERTY() - UUniversalTrackedComponent* TeleportationHand; + UMotionControllerComponent* TeleportationHand; UPROPERTY() - UUniversalTrackedComponent* RotationHand; + UMotionControllerComponent* RotationHand; UPROPERTY() class UInputMappingContext* IMCMovement; diff --git a/Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h b/Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h index af7c8f2d146080ea0ef8a437ec6f2c98a9a6b214..58d1b277f0bd11f6988f6ef9046db3ea97d02667 100644 --- a/Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h +++ b/Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h @@ -24,13 +24,13 @@ public: /* Proxy */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|Proxy Objects") - UUniversalTrackedComponent* Head; + UMotionControllerComponent* Head; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|Proxy Objects") - UUniversalTrackedComponent* RightHand; + UMotionControllerComponent* RightHand; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|Proxy Objects") - UUniversalTrackedComponent* LeftHand; + UMotionControllerComponent* LeftHand; /* Interaction */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|Interaction") @@ -39,11 +39,6 @@ public: /* Movement */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|Movement") UVRPawnMovement* PawnMovement; - - - UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|Movement") - USceneComponent* CapsuleRotationFix; - /* CameraComponent */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|Camera")