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.
master
Jeremy Hu 2019-06-25 22:13:57 +09:30
parent 6445f453c5
commit 7a33fa2531
1 changed files with 7 additions and 7 deletions

View File

@ -210,9 +210,9 @@ void PoseDocument::updateBonesFromParameters(std::vector<RiggerBone> *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<RiggerBone> *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);
//}
}
}