mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 20:58:38 +02:00
Fixing avatar orientation in recordings
This commit is contained in:
parent
e316f8dbb1
commit
9b6ec34f09
1 changed files with 12 additions and 10 deletions
|
@ -116,7 +116,7 @@ void AvatarData::setOrientation(const glm::quat& orientation, bool overideRefere
|
||||||
glm::vec3 eulerAngles = glm::degrees(safeEulerAngles(orientation));
|
glm::vec3 eulerAngles = glm::degrees(safeEulerAngles(orientation));
|
||||||
_bodyPitch = eulerAngles.x;
|
_bodyPitch = eulerAngles.x;
|
||||||
_bodyYaw = eulerAngles.y;
|
_bodyYaw = eulerAngles.y;
|
||||||
_bodyRoll = eulerAngles.z;
|
_bodyRoll = eulerAngles.z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1529,6 +1529,17 @@ QJsonObject AvatarData::toJson() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarData::fromJson(const QJsonObject& json) {
|
void AvatarData::fromJson(const QJsonObject& json) {
|
||||||
|
// The head setOrientation likes to overwrite the avatar orientation,
|
||||||
|
// so lets do the head first
|
||||||
|
// Most head data is relative to the avatar, and needs no basis correction,
|
||||||
|
// but the lookat vector does need correction
|
||||||
|
if (json.contains(JSON_AVATAR_HEAD)) {
|
||||||
|
if (!_headData) {
|
||||||
|
_headData = new HeadData(this);
|
||||||
|
}
|
||||||
|
_headData->fromJson(json[JSON_AVATAR_HEAD].toObject());
|
||||||
|
}
|
||||||
|
|
||||||
if (json.contains(JSON_AVATAR_HEAD_MODEL)) {
|
if (json.contains(JSON_AVATAR_HEAD_MODEL)) {
|
||||||
auto faceModelURL = json[JSON_AVATAR_HEAD_MODEL].toString();
|
auto faceModelURL = json[JSON_AVATAR_HEAD_MODEL].toString();
|
||||||
if (faceModelURL != getFaceModelURL().toString()) {
|
if (faceModelURL != getFaceModelURL().toString()) {
|
||||||
|
@ -1600,15 +1611,6 @@ void AvatarData::fromJson(const QJsonObject& json) {
|
||||||
}
|
}
|
||||||
setRawJointData(jointArray);
|
setRawJointData(jointArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Most head data is relative to the avatar, and needs no basis correction,
|
|
||||||
// but the lookat vector does need correction
|
|
||||||
if (json.contains(JSON_AVATAR_HEAD)) {
|
|
||||||
if (!_headData) {
|
|
||||||
_headData = new HeadData(this);
|
|
||||||
}
|
|
||||||
_headData->fromJson(json[JSON_AVATAR_HEAD].toObject());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Every frame will store both a basis for the recording and a relative transform
|
// Every frame will store both a basis for the recording and a relative transform
|
||||||
|
|
Loading…
Reference in a new issue