proper angle conversions for vectors

This commit is contained in:
Mamadou Babaei
2024-03-22 21:03:55 +01:00
parent 7587cd811e
commit c8bd51960d
@@ -55,13 +55,13 @@ public:
static FORCEINLINE FVector TransformToSenseGlove(const FVector& Vector) 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<typename V> template<typename V>
static FORCEINLINE V TransformToSenseGlove(const FVector& Vector) 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) static FORCEINLINE float TransformToUnreal(const float Radians)
@@ -114,13 +114,13 @@ public:
static FORCEINLINE FVector TransformToUnreal(const FVector& Vector) 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<typename V> template<typename V>
static FORCEINLINE FVector TransformToUnreal(const V& Vector) 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: public: