mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 15:10:31 +02:00
put some smoothing on the spine2 rotation in myskeletonmodel.cpp
This commit is contained in:
parent
83ec346cc5
commit
8f4fafe4d0
2 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue