mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:37:51 +02:00
Save transit preferences
This commit is contained in:
parent
80daf35e77
commit
0676f25e31
2 changed files with 9 additions and 7 deletions
|
@ -1027,7 +1027,7 @@ glm::vec3 MyAvatar::worldToJointPoint(const glm::vec3& position, const int joint
|
||||||
if (_skeletonModel->getJointPositionInWorldFrame(jointIndex, jointPos)) {
|
if (_skeletonModel->getJointPositionInWorldFrame(jointIndex, jointPos)) {
|
||||||
_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot);
|
_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot);
|
||||||
} else {
|
} else {
|
||||||
//qWarning() << "Invalid joint index specified: " << jointIndex;
|
qWarning() << "Invalid joint index specified: " << jointIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
glm::vec3 modelOffset = position - jointPos;
|
glm::vec3 modelOffset = position - jointPos;
|
||||||
|
@ -1049,7 +1049,7 @@ glm::vec3 MyAvatar::worldToJointDirection(const glm::vec3& worldDir, const int j
|
||||||
glm::quat MyAvatar::worldToJointRotation(const glm::quat& worldRot, const int jointIndex) const {
|
glm::quat MyAvatar::worldToJointRotation(const glm::quat& worldRot, const int jointIndex) const {
|
||||||
glm::quat jointRot = getWorldOrientation();//default value if no or invalid joint specified
|
glm::quat jointRot = getWorldOrientation();//default value if no or invalid joint specified
|
||||||
if ((jointIndex != -1) && (!_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot))) {
|
if ((jointIndex != -1) && (!_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot))) {
|
||||||
//qWarning() << "Invalid joint index specified: " << jointIndex;
|
qWarning() << "Invalid joint index specified: " << jointIndex;
|
||||||
}
|
}
|
||||||
glm::quat jointSpaceRot = glm::inverse(jointRot) * worldRot;
|
glm::quat jointSpaceRot = glm::inverse(jointRot) * worldRot;
|
||||||
return jointSpaceRot;
|
return jointSpaceRot;
|
||||||
|
@ -1063,7 +1063,7 @@ glm::vec3 MyAvatar::jointToWorldPoint(const glm::vec3& jointSpacePos, const int
|
||||||
if (_skeletonModel->getJointPositionInWorldFrame(jointIndex, jointPos)) {
|
if (_skeletonModel->getJointPositionInWorldFrame(jointIndex, jointPos)) {
|
||||||
_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot);
|
_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot);
|
||||||
} else {
|
} else {
|
||||||
//qWarning() << "Invalid joint index specified: " << jointIndex;
|
qWarning() << "Invalid joint index specified: " << jointIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1076,7 +1076,7 @@ glm::vec3 MyAvatar::jointToWorldPoint(const glm::vec3& jointSpacePos, const int
|
||||||
glm::vec3 MyAvatar::jointToWorldDirection(const glm::vec3& jointSpaceDir, const int jointIndex) const {
|
glm::vec3 MyAvatar::jointToWorldDirection(const glm::vec3& jointSpaceDir, const int jointIndex) const {
|
||||||
glm::quat jointRot = getWorldOrientation();//default value if no or invalid joint specified
|
glm::quat jointRot = getWorldOrientation();//default value if no or invalid joint specified
|
||||||
if ((jointIndex != -1) && (!_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot))) {
|
if ((jointIndex != -1) && (!_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot))) {
|
||||||
//qWarning() << "Invalid joint index specified: " << jointIndex;
|
qWarning() << "Invalid joint index specified: " << jointIndex;
|
||||||
}
|
}
|
||||||
glm::vec3 worldDir = jointRot * jointSpaceDir;
|
glm::vec3 worldDir = jointRot * jointSpaceDir;
|
||||||
return worldDir;
|
return worldDir;
|
||||||
|
@ -1085,7 +1085,7 @@ glm::vec3 MyAvatar::jointToWorldDirection(const glm::vec3& jointSpaceDir, const
|
||||||
glm::quat MyAvatar::jointToWorldRotation(const glm::quat& jointSpaceRot, const int jointIndex) const {
|
glm::quat MyAvatar::jointToWorldRotation(const glm::quat& jointSpaceRot, const int jointIndex) const {
|
||||||
glm::quat jointRot = getWorldOrientation();//default value if no or invalid joint specified
|
glm::quat jointRot = getWorldOrientation();//default value if no or invalid joint specified
|
||||||
if ((jointIndex != -1) && (!_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot))) {
|
if ((jointIndex != -1) && (!_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot))) {
|
||||||
//qWarning() << "Invalid joint index specified: " << jointIndex;
|
qWarning() << "Invalid joint index specified: " << jointIndex;
|
||||||
}
|
}
|
||||||
glm::quat worldRot = jointRot * jointSpaceRot;
|
glm::quat worldRot = jointRot * jointSpaceRot;
|
||||||
return worldRot;
|
return worldRot;
|
||||||
|
@ -1223,6 +1223,7 @@ void MyAvatar::saveData() {
|
||||||
settings.setValue("displayName", _displayName);
|
settings.setValue("displayName", _displayName);
|
||||||
settings.setValue("collisionSoundURL", _collisionSoundURL);
|
settings.setValue("collisionSoundURL", _collisionSoundURL);
|
||||||
settings.setValue("useSnapTurn", _useSnapTurn);
|
settings.setValue("useSnapTurn", _useSnapTurn);
|
||||||
|
settings.setValue("showTransit", _showTransit);
|
||||||
settings.setValue("userHeight", getUserHeight());
|
settings.setValue("userHeight", getUserHeight());
|
||||||
settings.setValue("flyingHMD", getFlyingHMDPref());
|
settings.setValue("flyingHMD", getFlyingHMDPref());
|
||||||
|
|
||||||
|
@ -1381,6 +1382,7 @@ void MyAvatar::loadData() {
|
||||||
setDisplayName(settings.value("displayName").toString());
|
setDisplayName(settings.value("displayName").toString());
|
||||||
setCollisionSoundURL(settings.value("collisionSoundURL", DEFAULT_AVATAR_COLLISION_SOUND_URL).toString());
|
setCollisionSoundURL(settings.value("collisionSoundURL", DEFAULT_AVATAR_COLLISION_SOUND_URL).toString());
|
||||||
setSnapTurn(settings.value("useSnapTurn", _useSnapTurn).toBool());
|
setSnapTurn(settings.value("useSnapTurn", _useSnapTurn).toBool());
|
||||||
|
setShowTransit(settings.value("showTransit", _showTransit).toBool());
|
||||||
setDominantHand(settings.value("dominantHand", _dominantHand).toString().toLower());
|
setDominantHand(settings.value("dominantHand", _dominantHand).toString().toLower());
|
||||||
setUserHeight(settings.value("userHeight", DEFAULT_AVATAR_HEIGHT).toDouble());
|
setUserHeight(settings.value("userHeight", DEFAULT_AVATAR_HEIGHT).toDouble());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
|
@ -249,8 +249,8 @@ void setupPreferences() {
|
||||||
preferences->addPreference(preference);
|
preferences->addPreference(preference);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto getter = [myAvatar]()->int { return myAvatar->getShowTransit() ? 0 : 1; };
|
auto getter = [myAvatar]()->int { return myAvatar->getShowTransit() ? 1 : 0; };
|
||||||
auto setter = [myAvatar](int value) { myAvatar->setShowTransit(value == 0); };
|
auto setter = [myAvatar](int value) { myAvatar->setShowTransit(value == 1); };
|
||||||
auto preference = new RadioButtonsPreference(VR_MOVEMENT, "Snap teleport / Smooth teleport", getter, setter);
|
auto preference = new RadioButtonsPreference(VR_MOVEMENT, "Snap teleport / Smooth teleport", getter, setter);
|
||||||
QStringList items;
|
QStringList items;
|
||||||
items << "Snap teleport" << "Smooth teleport";
|
items << "Snap teleport" << "Smooth teleport";
|
||||||
|
|
Loading…
Reference in a new issue