From 86db7ae4dd8673ca1eded36a36487b56390a876b Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Tue, 12 Mar 2024 19:35:16 +0100 Subject: [PATCH] apply a temporary workaround in order to ameliorate the hand animation after sgquat, sgvect3d fixes --- .../Private/SenseGlove/Components/SGVirtualHandComponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)};