diff --git a/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp b/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp index 82b27d25..6ce65730 100644 --- a/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp +++ b/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp @@ -445,7 +445,7 @@ TMap USGVirtualHandComponent::GetFingersBonesRotations() return MoveTemp(Rotations); } - const TArray> HandAngles{HandPose->GetHandAngles()}; + const TArray>& HandAngles{HandPose->GetHandAngles()}; for (int32 FingerIndex = 0; FingerIndex < HandAngles.Num(); ++FingerIndex) { @@ -454,7 +454,7 @@ TMap USGVirtualHandComponent::GetFingersBonesRotations() for (int32 JointIndex = 0; JointIndex < FingerJointAngles.Num(); ++JointIndex) { const FVector& JointAngle{FingerJointAngles[JointIndex]}; - const FQuat JointRotation{FQuat::MakeFromEuler(JointAngle)}; + const FQuat JointRotation{FQuat::MakeFromEuler(FVector{-JointAngle.Y, -JointAngle.X, -JointAngle.Z})}; const FTransform& BoneRefTransform{GetFingerBoneRefTransform(FingerIndex, JointIndex)};