From 8f87cd61ac248136e75463e51921f81d521a663f Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Thu, 14 Mar 2024 17:35:06 +0100 Subject: [PATCH] correct the hand mesh yaw rotation inside the sgpawn after the squat/sgvect3d changes --- .../SenseGlove/GameFramework/SGPawn.cpp | 22 ++++++++++++------- .../lib/win64/msvc142/debug/serial.lib | 2 +- .../lib/win64/msvc142/debug/sgconnect.lib | 2 +- .../lib/win64/msvc142/debug/sgcore.lib | 4 ++-- .../lib/win64/msvc142/release/serial.lib | 2 +- .../lib/win64/msvc142/release/sgconnect.lib | 2 +- .../lib/win64/msvc142/release/sgcore.lib | 4 ++-- .../lib/win64/msvc143/debug/serial.lib | 2 +- .../lib/win64/msvc143/debug/sgconnect.lib | 2 +- .../lib/win64/msvc143/debug/sgcore.lib | 4 ++-- .../lib/win64/msvc143/release/serial.lib | 2 +- .../lib/win64/msvc143/release/sgconnect.lib | 2 +- .../lib/win64/msvc143/release/sgcore.lib | 4 ++-- 13 files changed, 30 insertions(+), 24 deletions(-) diff --git a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp index 8f727a8b..2d653ff8 100644 --- a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp +++ b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp @@ -50,6 +50,8 @@ #include "SenseGlove/Components/SGWristTrackerComponent.h" #include "SGLog/SGLog.h" +static constexpr float SG_HAND_MESH_YAW_CORRECTION_OFFSET = -90.0f; + struct ASGPawn::FImpl { /************************ @@ -201,7 +203,7 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer) HandLeft->SetCollisionResponseToChannel(ECC_Destructible, ECR_Block); HandLeft->SetRight(false); HandLeft->SetHiddenIfNoGloveDetected(true); - HandLeft->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f}, + HandLeft->SetRelativeRotation(FRotator{0.0f, SG_HAND_MESH_YAW_CORRECTION_OFFSET, 0.0f}, false, nullptr, ETeleportType::None); HandLeft->SetRelativeLocation(FVector{30.0f, -20.0f, -10.0f}, false, nullptr, ETeleportType::None); @@ -225,7 +227,7 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer) RealHandLeft->SetRight(false); Pimpl->SetVisibility(RealHandLeft, false); RealHandLeft->SetHiddenIfNoGloveDetected(true); - RealHandLeft->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f}, + RealHandLeft->SetRelativeRotation(FRotator{0.0f, SG_HAND_MESH_YAW_CORRECTION_OFFSET, 0.0f}, false, nullptr, ETeleportType::None); RealHandLeft->SetRelativeLocation(FVector{30.0f, -20.0f, -10.0f}, false, nullptr, ETeleportType::None); @@ -428,7 +430,7 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer) HandRight->SetCollisionResponseToChannel(ECC_Destructible, ECR_Block); HandRight->SetRight(true); HandRight->SetHiddenIfNoGloveDetected(true); - HandRight->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f}, + HandRight->SetRelativeRotation(FRotator{0.0f, SG_HAND_MESH_YAW_CORRECTION_OFFSET, 0.0f}, false, nullptr, ETeleportType::None); HandRight->SetRelativeLocation(FVector{30.0f, 20.0f, -10.0f}, false, nullptr, ETeleportType::None); @@ -452,7 +454,7 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer) RealHandRight->SetRight(true); Pimpl->SetVisibility(RealHandRight, false); RealHandRight->SetHiddenIfNoGloveDetected(true); - RealHandRight->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f}, + RealHandRight->SetRelativeRotation(FRotator{0.0f, SG_HAND_MESH_YAW_CORRECTION_OFFSET, 0.0f}, false, nullptr, ETeleportType::None); RealHandRight->SetRelativeLocation(FVector{30.0f, 20.0f, -10.0f}, false, nullptr, ETeleportType::None); @@ -1829,20 +1831,24 @@ void ASGPawn::FImpl::UpdateHandRotation(const bool bRight, const FRotator& Rotat void ASGPawn::FImpl::UpdateLeftHandRotation(const FRotator& Rotation, const bool bUpdateVirtualHand) { + static const FQuat Offset{FQuat::MakeFromEuler(FVector{0.0f, 0.0f, SG_HAND_MESH_YAW_CORRECTION_OFFSET})}; + const FQuat NewRotation{Rotation.Quaternion() * Offset}; if (bUpdateVirtualHand) { - Owner->HandLeft->SetWorldRotation(Rotation); + Owner->HandLeft->SetWorldRotation(NewRotation); } - Owner->RealHandLeft->SetWorldRotation(Rotation); + Owner->RealHandLeft->SetWorldRotation(NewRotation); } void ASGPawn::FImpl::UpdateRightHandRotation(const FRotator& Rotation, const bool bUpdateVirtualHand) { + static const FQuat Offset{FQuat::MakeFromEuler(FVector{0.0f, 0.0f, SG_HAND_MESH_YAW_CORRECTION_OFFSET})}; + const FQuat NewRotation{Rotation.Quaternion() * Offset}; if (bUpdateVirtualHand) { - Owner->HandRight->SetWorldRotation(Rotation); + Owner->HandRight->SetWorldRotation(NewRotation); } - Owner->RealHandRight->SetWorldRotation(Rotation); + Owner->RealHandRight->SetWorldRotation(NewRotation); } void ASGPawn::FImpl::UpdateHandLocationAndRotation( diff --git a/Source/ThirdParty/lib/win64/msvc142/debug/serial.lib b/Source/ThirdParty/lib/win64/msvc142/debug/serial.lib index 4add4beb..970b30f6 100644 --- a/Source/ThirdParty/lib/win64/msvc142/debug/serial.lib +++ b/Source/ThirdParty/lib/win64/msvc142/debug/serial.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:123b2f3bc57d6eca50d60a221ab8c327908fe87164592957324907d5f4268e86 +oid sha256:8e1ce37d8b4be6820c40f66fcf3cb516d505f16bcf25c3d33123ce3af4c88b6e size 1219882 diff --git a/Source/ThirdParty/lib/win64/msvc142/debug/sgconnect.lib b/Source/ThirdParty/lib/win64/msvc142/debug/sgconnect.lib index 4f6609f9..b1c3c36c 100644 --- a/Source/ThirdParty/lib/win64/msvc142/debug/sgconnect.lib +++ b/Source/ThirdParty/lib/win64/msvc142/debug/sgconnect.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7a826e2ece4d54a6d88b7d1f1d76630c85d18a326c2fb2b2155b44367058dbf5 +oid sha256:7fb06292c9f12cebaa204a37b8d770bf3205745e22450cf59e6e1ac936540395 size 14380012 diff --git a/Source/ThirdParty/lib/win64/msvc142/debug/sgcore.lib b/Source/ThirdParty/lib/win64/msvc142/debug/sgcore.lib index 2fa3430b..d70e7261 100644 --- a/Source/ThirdParty/lib/win64/msvc142/debug/sgcore.lib +++ b/Source/ThirdParty/lib/win64/msvc142/debug/sgcore.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d93ae81dd7409b5e70f0ce62c11b82c4f6f7f3ea695bd61a5af01990c563a5f8 -size 21813462 +oid sha256:df0794f4eb971177e33b2bd590c59121a2290d53551c362a0851f73641566c9d +size 21813620 diff --git a/Source/ThirdParty/lib/win64/msvc142/release/serial.lib b/Source/ThirdParty/lib/win64/msvc142/release/serial.lib index 3e84c681..3cdf3a89 100644 --- a/Source/ThirdParty/lib/win64/msvc142/release/serial.lib +++ b/Source/ThirdParty/lib/win64/msvc142/release/serial.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7d80365a7ca541107a752fa64ddf497abe139d3a7c451b056d156fd5ead7d806 +oid sha256:fa32eff5cbeb6a722c5562efdfd781e522e9e86355f6db89cc1bd51822d8f2f0 size 351186 diff --git a/Source/ThirdParty/lib/win64/msvc142/release/sgconnect.lib b/Source/ThirdParty/lib/win64/msvc142/release/sgconnect.lib index 139b6d87..6438774e 100644 --- a/Source/ThirdParty/lib/win64/msvc142/release/sgconnect.lib +++ b/Source/ThirdParty/lib/win64/msvc142/release/sgconnect.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cc77448a8870e72739fbb5e01c1376d9f68a6bcb5a862d8e3b26c6d69ba6a525 +oid sha256:be3571516dfdbb23f6738fe9a3d978a4974c5cd252a668f8ead4781f2e854f09 size 3003480 diff --git a/Source/ThirdParty/lib/win64/msvc142/release/sgcore.lib b/Source/ThirdParty/lib/win64/msvc142/release/sgcore.lib index dca5d318..f62c533e 100644 --- a/Source/ThirdParty/lib/win64/msvc142/release/sgcore.lib +++ b/Source/ThirdParty/lib/win64/msvc142/release/sgcore.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:643fec9d31e656692ca630a33a550d7c3e80251d70c4a9b991334db2dfca8b9b -size 5091030 +oid sha256:c6e54d7c4d097a28fb0736c05a0679395bd55063724942dbebc9169c20c99ea6 +size 5091100 diff --git a/Source/ThirdParty/lib/win64/msvc143/debug/serial.lib b/Source/ThirdParty/lib/win64/msvc143/debug/serial.lib index b7f3a96f..4f895afc 100644 --- a/Source/ThirdParty/lib/win64/msvc143/debug/serial.lib +++ b/Source/ThirdParty/lib/win64/msvc143/debug/serial.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2d6da747edbaabe2ca2e7dae90ae94352f4fb2597852be06d01834d1aa9fee74 +oid sha256:5a4421941e4688db4fd05c5a44a3f52d49ec0cc1277e614b982901c3ed478614 size 1197698 diff --git a/Source/ThirdParty/lib/win64/msvc143/debug/sgconnect.lib b/Source/ThirdParty/lib/win64/msvc143/debug/sgconnect.lib index e7cf8730..9eacc4d3 100644 --- a/Source/ThirdParty/lib/win64/msvc143/debug/sgconnect.lib +++ b/Source/ThirdParty/lib/win64/msvc143/debug/sgconnect.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:73601cc7a5dc3bf9012ae9790edde7d8794f31bc2d9feb0f33091cf75a082a76 +oid sha256:a3a68665b47856192965ed6c68fc1238bae118593e700849f9f9c400e259cd2a size 14868052 diff --git a/Source/ThirdParty/lib/win64/msvc143/debug/sgcore.lib b/Source/ThirdParty/lib/win64/msvc143/debug/sgcore.lib index b608eb79..8a3046d1 100644 --- a/Source/ThirdParty/lib/win64/msvc143/debug/sgcore.lib +++ b/Source/ThirdParty/lib/win64/msvc143/debug/sgcore.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:74994f615db6d1c9cb8daa7720d80415b24c8b53ad2151b0c7172e4a31bb6527 -size 21927724 +oid sha256:58819d4ab952531e2c853f103c6f01b3d34f631d0f64cf44aec7f1dbc569dfd7 +size 21927898 diff --git a/Source/ThirdParty/lib/win64/msvc143/release/serial.lib b/Source/ThirdParty/lib/win64/msvc143/release/serial.lib index 42ca1484..e403bef6 100644 --- a/Source/ThirdParty/lib/win64/msvc143/release/serial.lib +++ b/Source/ThirdParty/lib/win64/msvc143/release/serial.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f3e2de7df8b07d2ecaa684d5508baf2ea347f7e0aa54967e3463bd8a8ae26d8e +oid sha256:ac0b73b44bbf493a2c338ec63d4489557b41da5f10fdd711c6c3942cdfd6f2e1 size 336716 diff --git a/Source/ThirdParty/lib/win64/msvc143/release/sgconnect.lib b/Source/ThirdParty/lib/win64/msvc143/release/sgconnect.lib index 2b376bdb..a0adf29e 100644 --- a/Source/ThirdParty/lib/win64/msvc143/release/sgconnect.lib +++ b/Source/ThirdParty/lib/win64/msvc143/release/sgconnect.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:75636b22fcfa6950676c189abe6e41883b3ee69fcf2ec8e8776645adad39830a +oid sha256:b63c66bacf32c505052115a8acfdf2bfee24924293da3070b57aa5288ef82a6e size 2879430 diff --git a/Source/ThirdParty/lib/win64/msvc143/release/sgcore.lib b/Source/ThirdParty/lib/win64/msvc143/release/sgcore.lib index faa80f05..850846b6 100644 --- a/Source/ThirdParty/lib/win64/msvc143/release/sgcore.lib +++ b/Source/ThirdParty/lib/win64/msvc143/release/sgcore.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4023f0fcf37450273d55b54389384cb552cd886a09178caa47b4adcc9b977a42 -size 4892640 +oid sha256:7361453afbccea62555b196643fb559f48188d62697350836cd63ced594712e7 +size 4892708