diff --git a/Source/RWTHVRToolkit/Private/Pawn/ContinuousMovementComponent.cpp b/Source/RWTHVRToolkit/Private/Pawn/ContinuousMovementComponent.cpp index 9177fb244f9751ae3d8f44cccb94f44116ebf706..7630cb3378d7fc74bc729074e7efb742526545e8 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/ContinuousMovementComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/ContinuousMovementComponent.cpp @@ -38,7 +38,7 @@ void UContinuousMovementComponent::SetupInputActions() UEnhancedInputLocalPlayerSubsystem* InputSubsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer()); if(!InputSubsystem) { - UE_LOG(LogTemp,Error,TEXT("InputSubsystem IS NOT VALID")); + UE_LOG(Toolkit,Error,TEXT("InputSubsystem IS NOT VALID")); return; } // add Input Mapping context @@ -47,7 +47,7 @@ void UContinuousMovementComponent::SetupInputActions() UEnhancedInputComponent* EI = Cast<UEnhancedInputComponent>(VRPawn->InputComponent); if(!EI) { - UE_LOG(LogTemp,Error,TEXT("Cannot cast Input Component to Enhanced Inpu Component in VRPawnMovement")); + UE_LOG(Toolkit,Error,TEXT("Cannot cast Input Component to Enhanced Inpu Component in VRPawnMovement")); return; } @@ -180,5 +180,5 @@ void UContinuousMovementComponent::OnBeginUp(const FInputActionValue& Value) { const float MoveValue = Value.Get<FVector2D>().X; //the right hand is rotated on desktop to follow the cursor so it's forward is also changing with cursor position - VRPawn->AddMovementInput(VRPawn->Head->GetUpVector(), MoveValue); + VRPawn->AddMovementInput(FVector::UpVector, MoveValue); } diff --git a/Source/RWTHVRToolkit/Private/Pawn/VRPawnMovement.cpp b/Source/RWTHVRToolkit/Private/Pawn/VRPawnMovement.cpp index 4b32da4736f6a6e3ea7b9423fac8540926985126..f1b4720d2ff23ecd7682b3c26d63139793d6fee6 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/VRPawnMovement.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/VRPawnMovement.cpp @@ -130,11 +130,11 @@ void UVRPawnMovement::ShiftVertically(float DiffernceDistance, float VerticalAcc VerticalSpeed += VerticalAcceleration * DeltaSeconds; if (VerticalSpeed*DeltaSeconds < DiffernceDistance) { - UpdatedComponent->AddLocalOffset(FVector(0.f, 0.f, Direction * VerticalSpeed * DeltaSeconds)); + UpdatedComponent->AddWorldOffset(FVector(0.f, 0.f, Direction * VerticalSpeed * DeltaSeconds)); } else { - UpdatedComponent->AddLocalOffset(FVector(0.f, 0.f, Direction * DiffernceDistance)); + UpdatedComponent->AddWorldOffset(FVector(0.f, 0.f, Direction * DiffernceDistance)); VerticalSpeed = 0; } } diff --git a/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp b/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp index c94916dc6f86a82b590616337ecd20bd0d52c970..276cfb1faeacd4ae118b4fb9fd61fa4199ca6115 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp @@ -2,7 +2,6 @@ #include "Pawn/VirtualRealityPawn.h" -#include "AITypes.h" #include "Engine/LocalPlayer.h" #include "GameFramework/PlayerController.h" #include "Pawn/UniversalTrackedComponent.h" diff --git a/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp b/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp index 01f92157896d42525e9a22c428402a4ad8edbd60..4beeb13e57bea136a1c1e0054e57b6fe2cb19610 100644 --- a/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp +++ b/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp @@ -15,6 +15,9 @@ #include "IHeadMountedDisplay.h" #include "AudioDevice.h" + +DEFINE_LOG_CATEGORY(Toolkit); + bool UVirtualRealityUtilities::IsDesktopMode() { return !IsRoomMountedMode() && !IsHeadMountedMode(); diff --git a/Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h b/Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h index aff028d969a87c23db8bbfc032e5687e64184378..01e71bae9d5f446f01d1505f327acb83595ce955 100644 --- a/Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h +++ b/Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h @@ -12,11 +12,6 @@ class UCameraComponent; class ULiveLinkComponentController; -/** - * Custom logging for all RWTHToolkit related stuff - */ - - /** * */ diff --git a/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h b/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h index 9e49046ba83c4056b35fb27170d0fadb3e9acdc0..19e7a71953d7a16028cc6a56614256afa7d70e83 100644 --- a/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h +++ b/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h @@ -5,6 +5,14 @@ #include "UObject/ConstructorHelpers.h" #include "VirtualRealityUtilities.generated.h" + + +/** + * Custom log category for all RWTHVRToolkit related components + */ +DECLARE_LOG_CATEGORY_EXTERN(Toolkit, Log, All); + + UENUM(BlueprintType) enum class ENamedClusterComponent : uint8 {