From 7a33fa2531f369a39aaffced143d54f4c7060cd9 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Tue, 25 Jun 2019 22:13:57 +0930 Subject: [PATCH] Remove neck direction match The neck direction match is introduced for matching the human pose to a animal pose, however, current implementation will cause the neck pose not work as edited in pose editor. --- src/posedocument.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/posedocument.cpp b/src/posedocument.cpp index c4e506f1..2d1e1042 100644 --- a/src/posedocument.cpp +++ b/src/posedocument.cpp @@ -210,9 +210,9 @@ void PoseDocument::updateBonesFromParameters(std::vector *bones, boneScaleFactor = firstSpineBoneLengthFromParameters / firstSpineBoneLength; firstSpineBonePositionOffset = firstSpineBonePositionFromParameters - firstSpineBonePosition; } - QVector3D neckJoint1DirectionInParameters; - neckJoint1DirectionFromParameters(parameters, &neckJoint1DirectionInParameters); - QQuaternion neckJoint1Rotation = QQuaternion::rotationTo(neckJoint1DirectionInParameters, neckJoint1BoneDirection); + //QVector3D neckJoint1DirectionInParameters; + //neckJoint1DirectionFromParameters(parameters, &neckJoint1DirectionInParameters); + //QQuaternion neckJoint1Rotation = QQuaternion::rotationTo(neckJoint1DirectionInParameters, neckJoint1BoneDirection); for (auto &bone: *bones) { const auto findParameterResult = parameters.find(bone.name); if (findParameterResult == parameters.end()) { @@ -252,10 +252,10 @@ void PoseDocument::updateBonesFromParameters(std::vector *bones, bone.tailPosition = toPosition; } } - if (bone.name.startsWith("Neck_")) { - bone.tailPosition = bone.headPosition + - neckJoint1Rotation.rotatedVector(bone.tailPosition - bone.headPosition); - } + //if (bone.name.startsWith("Neck_")) { + //bone.tailPosition = bone.headPosition + + // neckJoint1Rotation.rotatedVector(bone.tailPosition - bone.headPosition); + //} } }