mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-12 19:25:04 +02:00
Back to using matrices.
This commit is contained in:
parent
1f8bed9d9c
commit
41775912d8
2 changed files with 4 additions and 2 deletions
|
@ -47,7 +47,8 @@ void FaceModel::simulate(float deltaTime) {
|
|||
void FaceModel::maybeUpdateNeckRotation(const JointState& parentState, const FBXJoint& joint, JointState& state) {
|
||||
// get the rotation axes in joint space and use them to adjust the rotation
|
||||
glm::mat3 axes = glm::mat3_cast(_rotation);
|
||||
glm::quat inverse = parentState.combinedRotation * joint.preRotation * joint.rotation;
|
||||
glm::mat3 inverse = glm::mat3(glm::inverse(parentState.transform *
|
||||
joint.preTransform * glm::mat4_cast(joint.preRotation * joint.rotation)));
|
||||
state.rotation = glm::angleAxis(_owningHead->getRoll(), glm::normalize(inverse * axes[2])) *
|
||||
glm::angleAxis(_owningHead->getYaw(), glm::normalize(inverse * axes[1])) *
|
||||
glm::angleAxis(_owningHead->getPitch(), glm::normalize(inverse * axes[0])) * joint.rotation;
|
||||
|
|
|
@ -71,7 +71,8 @@ void SkeletonModel::updateJointState(int index) {
|
|||
void SkeletonModel::maybeUpdateLeanRotation(const JointState& parentState, const FBXJoint& joint, JointState& state) {
|
||||
// get the rotation axes in joint space and use them to adjust the rotation
|
||||
glm::mat3 axes = glm::mat3_cast(_rotation);
|
||||
glm::quat inverse = parentState.combinedRotation * joint.preRotation * joint.rotation;
|
||||
glm::mat3 inverse = glm::mat3(glm::inverse(parentState.transform *
|
||||
joint.preTransform * glm::mat4_cast(joint.preRotation * joint.rotation)));
|
||||
state.rotation = glm::angleAxis(-_owningAvatar->getHead().getLeanSideways(), glm::normalize(inverse * axes[2])) *
|
||||
glm::angleAxis(-_owningAvatar->getHead().getLeanForward(), glm::normalize(inverse * axes[0])) * joint.rotation;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue