From c8bd51960d970b511248a20c9fbce6a91bbbac1b Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Tue, 12 Mar 2024 15:05:51 +0100 Subject: [PATCH] proper angle conversions for vectors --- Source/SenseGloveUtils/Public/SGUtils/SGAngles.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/SenseGloveUtils/Public/SGUtils/SGAngles.h b/Source/SenseGloveUtils/Public/SGUtils/SGAngles.h index 6f63685f..7843eaea 100644 --- a/Source/SenseGloveUtils/Public/SGUtils/SGAngles.h +++ b/Source/SenseGloveUtils/Public/SGUtils/SGAngles.h @@ -55,13 +55,13 @@ public: static FORCEINLINE FVector TransformToSenseGlove(const FVector& Vector) { - return FMath::DegreesToRadians(FVector(-Vector.Y, Vector.X, Vector.Z)); + return FMath::DegreesToRadians(FVector(-Vector.X, Vector.Y, -Vector.Z)); } template static FORCEINLINE V TransformToSenseGlove(const FVector& Vector) { - return FMath::DegreesToRadians(V(-Vector.Y, Vector.X, Vector.Z)); + return FMath::DegreesToRadians(V(-Vector.X, Vector.Y, -Vector.Z)); } static FORCEINLINE float TransformToUnreal(const float Radians) @@ -114,13 +114,13 @@ public: static FORCEINLINE FVector TransformToUnreal(const FVector& Vector) { - return FMath::RadiansToDegrees(FVector(-Vector.Y, Vector.X, Vector.Z)); + return FMath::RadiansToDegrees(FVector(-Vector.X, Vector.Y, -Vector.Z)); } template static FORCEINLINE FVector TransformToUnreal(const V& Vector) { - return FMath::RadiansToDegrees(FVector(-Vector.GetY(), Vector.GetX(), Vector.GetZ())); + return FMath::RadiansToDegrees(FVector(-Vector.GetX(), Vector.GetY(), -Vector.GetZ())); } public: