mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-17 22:08:05 +02:00
Merge pull request #5870 from howard-stearns/apostrophe
Apostrophe key resets animation state.
This commit is contained in:
commit
7822d58164
3 changed files with 21 additions and 1 deletions
|
@ -151,6 +151,25 @@ void MyAvatar::reset() {
|
|||
eulers.x = 0.0f;
|
||||
eulers.z = 0.0f;
|
||||
setOrientation(glm::quat(eulers));
|
||||
|
||||
// This should be simpler when we have only graph animations always on.
|
||||
bool isRig = _rig->getEnableRig();
|
||||
bool isGraph = _rig->getEnableAnimGraph();
|
||||
qApp->setRawAvatarUpdateThreading(false);
|
||||
_rig->disableHands = true;
|
||||
setEnableRigAnimations(true);
|
||||
_skeletonModel.simulate(0.1f); // non-zero
|
||||
setEnableRigAnimations(false);
|
||||
_skeletonModel.simulate(0.1f);
|
||||
if (isRig) {
|
||||
setEnableRigAnimations(true);
|
||||
Menu::getInstance()->setIsOptionChecked(MenuOption::EnableRigAnimations, true);
|
||||
} else if (isGraph) {
|
||||
setEnableAnimGraph(true);
|
||||
Menu::getInstance()->setIsOptionChecked(MenuOption::EnableAnimGraph, true);
|
||||
}
|
||||
_rig->disableHands = false;
|
||||
qApp->setRawAvatarUpdateThreading();
|
||||
}
|
||||
|
||||
void MyAvatar::update(float deltaTime) {
|
||||
|
|
|
@ -738,7 +738,7 @@ void Rig::inverseKinematics(int endIndex, glm::vec3 targetPosition, const glm::q
|
|||
return;
|
||||
}
|
||||
|
||||
if (_enableAnimGraph && _animSkeleton) {
|
||||
if (disableHands || (_enableAnimGraph && _animSkeleton)) {
|
||||
// the hand data goes through a different path: Rig::updateFromHandParameters() --> early-exit
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -193,6 +193,7 @@ public:
|
|||
|
||||
AnimNode::ConstPointer getAnimNode() const { return _animNode; }
|
||||
AnimSkeleton::ConstPointer getAnimSkeleton() const { return _animSkeleton; }
|
||||
bool disableHands {false}; // should go away with rig animation (and Rig::inverseKinematics)
|
||||
|
||||
protected:
|
||||
|
||||
|
|
Loading…
Reference in a new issue