mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-03 23:24:35 +02:00
Initial Commit to resolve problem :> When Max Avatar scale is set in Sandbox -> setting, take that value as default max value
This commit is contained in:
parent
685b1c2445
commit
dd2dbd9b39
1 changed files with 10 additions and 6 deletions
|
@ -68,7 +68,6 @@ const float MAX_WALKING_SPEED = 2.6f; // human walking speed
|
|||
const float MAX_BOOST_SPEED = 0.5f * MAX_WALKING_SPEED; // action motor gets additive boost below this speed
|
||||
const float MIN_AVATAR_SPEED = 0.05f;
|
||||
const float MIN_AVATAR_SPEED_SQUARED = MIN_AVATAR_SPEED * MIN_AVATAR_SPEED; // speed is set to zero below this
|
||||
const float DEFAULT_MAX_AVATAR_SCALE = 3.0f;
|
||||
|
||||
const float YAW_SPEED_DEFAULT = 120.0f; // degrees/sec
|
||||
const float PITCH_SPEED_DEFAULT = 90.0f; // degrees/sec
|
||||
|
@ -1076,10 +1075,6 @@ void MyAvatar::loadData() {
|
|||
|
||||
getHead()->setBasePitch(loadSetting(settings, "headPitch", 0.0f));
|
||||
|
||||
_targetScale = loadSetting(settings, "scale", 1.0f);
|
||||
_targetScale = (_targetScale > DEFAULT_MAX_AVATAR_SCALE) ? DEFAULT_MAX_AVATAR_SCALE : _targetScale;
|
||||
setScale(glm::vec3(_targetScale));
|
||||
|
||||
_prefOverrideAnimGraphUrl.set(QUrl(settings.value("animGraphURL", "").toString()));
|
||||
_fullAvatarURLFromPreferences = settings.value("fullAvatarURL", AvatarData::defaultFullAvatarModelUrl()).toUrl();
|
||||
_fullAvatarModelName = settings.value("fullAvatarModelName", DEFAULT_FULL_AVATAR_MODEL_NAME).toString();
|
||||
|
@ -2270,7 +2265,16 @@ void MyAvatar::restrictScaleFromDomainSettings(const QJsonObject& domainSettings
|
|||
static const QString MAX_SCALE_OPTION = "max_avatar_scale";
|
||||
float settingMaxScale = avatarsObject[MAX_SCALE_OPTION].toDouble(MAX_AVATAR_SCALE);
|
||||
setDomainMaximumScale(settingMaxScale);
|
||||
|
||||
|
||||
// Set avatar scale. The current avatar scale should not be more than domain's max_avatar_scale.
|
||||
Settings settings;
|
||||
settings.beginGroup("Avatar");
|
||||
_targetScale = loadSetting(settings, "scale", 1.0f);
|
||||
qCDebug(interfaceapp, "Current avatar scale is %f. Receive max_avatar_scale %f from this domain settings. Selecting the minimum value to set the scale of an avatar.", _targetScale, _domainMaximumScale);
|
||||
_targetScale = (_targetScale > _domainMaximumScale) ? _domainMaximumScale : _targetScale;
|
||||
qCDebug(interfaceapp) << "Avatar scale " << _targetScale;
|
||||
setScale(glm::vec3(_targetScale));
|
||||
settings.endGroup();
|
||||
// make sure that the domain owner didn't flip min and max
|
||||
if (_domainMinimumScale > _domainMaximumScale) {
|
||||
std::swap(_domainMinimumScale, _domainMaximumScale);
|
||||
|
|
Loading…
Reference in a new issue