mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Align avatar body to head on reset.
This commit is contained in:
parent
2c276bb13e
commit
db955d894f
1 changed files with 2 additions and 0 deletions
|
@ -141,6 +141,7 @@ QByteArray MyAvatar::toByteArray(bool cullSmallChanges, bool sendAll) {
|
|||
|
||||
void MyAvatar::reset() {
|
||||
_skeletonModel.reset();
|
||||
float headYaw = getHead()->getBaseYaw(); // degrees
|
||||
getHead()->reset();
|
||||
|
||||
_targetVelocity = glm::vec3(0.0f);
|
||||
|
@ -148,6 +149,7 @@ void MyAvatar::reset() {
|
|||
// Reset the pitch and roll components of the avatar's orientation, preserve yaw direction
|
||||
glm::vec3 eulers = safeEulerAngles(getOrientation());
|
||||
eulers.x = 0.0f;
|
||||
eulers.y += headYaw; // align body with head
|
||||
eulers.z = 0.0f;
|
||||
setOrientation(glm::quat(eulers));
|
||||
|
||||
|
|
Loading…
Reference in a new issue