put some smoothing on the spine2 rotation in myskeletonmodel.cpp

This commit is contained in:
amantley 2018-10-18 08:44:01 -07:00
parent 83ec346cc5
commit 8f4fafe4d0
2 changed files with 2 additions and 2 deletions

View file

@ -878,7 +878,7 @@ glm::vec2 MyAvatar::computeHandAzimuth() const {
if (!(spine2Index < 0)) {
// use the spine for the azimuth origin.
spine2Position = getAbsoluteJointTranslationInObjectFrame(spine2Index);
glm::quat spine2Rotation = getAbsoluteJointRotationInObjectFrame(spine2Index);
spine2Rotation = getAbsoluteJointRotationInObjectFrame(spine2Index);
}
glm::vec3 rightHandOffset = rightHandPoseAvatarSpace.translation - spine2Position;
glm::vec3 leftHandOffset = leftHandPoseAvatarSpace.translation - spine2Position;

View file

@ -261,7 +261,7 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) {
}
generateBasisVectors(up, fwd, u, v, w);
AnimPose newSpinePose(glm::mat4(glm::vec4(w, 0.0f), glm::vec4(u, 0.0f), glm::vec4(v, 0.0f), glm::vec4(glm::vec3(0.0f, 0.0f, 0.0f), 1.0f)));
currentSpine2Pose.rot() = newSpinePose.rot();
currentSpine2Pose.rot() = safeLerp(currentSpine2Pose.rot(), newSpinePose.rot(), 0.5f);
params.primaryControllerPoses[Rig::PrimaryControllerType_Spine2] = currentSpine2Pose;
params.primaryControllerFlags[Rig::PrimaryControllerType_Spine2] = (uint8_t)Rig::ControllerFlags::Enabled | (uint8_t)Rig::ControllerFlags::Estimated;
}