diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llcharacter/llcharacter.h | 2 | ||||
-rwxr-xr-x | indra/llcharacter/llkeyframemotion.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/app_settings/settings_per_account.xml | 10 | ||||
-rwxr-xr-x | indra/newview/llfloaterhoverheight.cpp | 21 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 13 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.h | 5 | ||||
-rwxr-xr-x | indra/newview/llvoavatarself.cpp | 3 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/floater_edit_hover_height.xml | 2 |
8 files changed, 30 insertions, 27 deletions
diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index d4e3b76386..085b681854 100755 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -261,6 +261,8 @@ public: static std::vector< LLCharacter* > sInstances; static BOOL sAllowInstancesChange ; //debug use + LLVector3 mHoverOffset; + protected: LLMotionController mMotionController; diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 22aa4f1d2f..89bec40323 100755 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -984,6 +984,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 { case CONSTRAINT_TARGET_TYPE_GROUND: target_pos = mCharacter->getPosAgentFromGlobal(constraint->mGroundPos); + target_pos += mCharacter->mHoverOffset; // LL_INFOS() << "Target Pos " << constraint->mGroundPos << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL; break; case CONSTRAINT_TARGET_TYPE_BODY: diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 7975fe9e3a..d119504017 100755 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -1,19 +1,15 @@ <llsd> <map> - <key>AvatarPosFinalOffset</key> + <key>AvatarHoverOffsetZ</key> <map> <key>Comment</key> - <string>After-everything-else fixup for avatar position.</string> + <string>After-everything-else fixup for avatar Z position.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Vector3</string> + <string>F32</string> <key>Value</key> - <array> <real>0.0</real> - <real>0.0</real> - <real>0.0</real> - </array> </map> <key>DoNotDisturbResponseChanged</key> <map> diff --git a/indra/newview/llfloaterhoverheight.cpp b/indra/newview/llfloaterhoverheight.cpp index 9efb168b55..2ac61efc0c 100755 --- a/indra/newview/llfloaterhoverheight.cpp +++ b/indra/newview/llfloaterhoverheight.cpp @@ -42,14 +42,16 @@ LLFloaterHoverHeight::LLFloaterHoverHeight(const LLSD& key) : LLFloater(key) void LLFloaterHoverHeight::syncFromPreferenceSetting(void *user_data) { - LLVector3 offset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); - F32 value = offset[2]; + F32 value = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ"); LLFloaterHoverHeight *self = static_cast<LLFloaterHoverHeight*>(user_data); LLSliderCtrl* sldrCtrl = self->getChild<LLSliderCtrl>("HoverHeightSlider"); sldrCtrl->setValue(value,FALSE); + if (isAgentAvatarValid()) { + LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z)); + gAgentAvatarp->mHoverOffset = offset; gAgentAvatarp->sendHoverHeight(); } } @@ -57,6 +59,8 @@ void LLFloaterHoverHeight::syncFromPreferenceSetting(void *user_data) BOOL LLFloaterHoverHeight::postBuild() { LLSliderCtrl* sldrCtrl = getChild<LLSliderCtrl>("HoverHeightSlider"); + sldrCtrl->setMinValue(MIN_HOVER_Z); + sldrCtrl->setMaxValue(MAX_HOVER_Z); sldrCtrl->setSliderMouseUpCallback(boost::bind(&LLFloaterHoverHeight::onFinalCommit,this)); sldrCtrl->setSliderEditorCommitCallback(boost::bind(&LLFloaterHoverHeight::onFinalCommit,this)); childSetCommitCallback("HoverHeightSlider", &LLFloaterHoverHeight::onSliderMoved, NULL); @@ -64,13 +68,13 @@ BOOL LLFloaterHoverHeight::postBuild() // Initialize slider from pref setting. syncFromPreferenceSetting(this); // Update slider on future pref changes. - if (gSavedPerAccountSettings.getControl("AvatarPosFinalOffset")) + if (gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")) { - gSavedPerAccountSettings.getControl("AvatarPosFinalOffset")->getCommitSignal()->connect(boost::bind(&syncFromPreferenceSetting, this)); + gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")->getCommitSignal()->connect(boost::bind(&syncFromPreferenceSetting, this)); } else { - LL_WARNS() << "Control not found for AvatarPosFinalOffset" << LL_ENDL; + LL_WARNS() << "Control not found for AvatarHoverOffsetZ" << LL_ENDL; } return TRUE; @@ -81,8 +85,7 @@ void LLFloaterHoverHeight::onSliderMoved(LLUICtrl* ctrl, void* userData) { LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); F32 value = sldrCtrl->getValueF32(); - LLVector3 offset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); - offset[2] = value; + LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z)); gAgentAvatarp->mHoverOffset = offset; } @@ -92,9 +95,7 @@ void LLFloaterHoverHeight::onFinalCommit() { LLSliderCtrl* sldrCtrl = getChild<LLSliderCtrl>("HoverHeightSlider"); F32 value = sldrCtrl->getValueF32(); - LLVector3 offset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); - offset[2] = value; - gSavedPerAccountSettings.setVector3("AvatarPosFinalOffset",offset); + gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ",value); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index aeb9c8bbf6..aa7b848d0e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -111,6 +111,9 @@ extern F32 ANIM_SPEED_MAX; extern F32 ANIM_SPEED_MIN; extern U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG; +const F32 MAX_HOVER_Z = 2.0; +const F32 MIN_HOVER_Z = -2.0; + // #define OUTPUT_BREAST_DATA using namespace LLAvatarAppearanceDefines; @@ -718,11 +721,11 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mIsEditingAppearance(FALSE), mUseLocalAppearance(FALSE), mLastUpdateRequestCOFVersion(-1), - mLastUpdateReceivedCOFVersion(-1), - mHoverOffset(0.0, 0.0, 0.0) + mLastUpdateReceivedCOFVersion(-1) + //mHoverOffset(0.0, 0.0, 0.0) { //VTResume(); // VTune - + mHoverOffset = LLVector3(0.0, 0.0, 0.0); // mVoiceVisualizer is created by the hud effects manager and uses the HUD Effects pipeline const BOOL needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim ); @@ -7467,11 +7470,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) mHoverOffset = contents.mHoverOffset; } - if (!contents.mHoverOffsetWasSet) + if (!contents.mHoverOffsetWasSet && !isSelf()) { // If we don't get a value at all, we are presumably in a // region that does not support hover height. - LL_WARNS() << "zeroing hover because not defined in appearance message" << LL_ENDL; + LL_WARNS() << avString() << "zeroing hover because not defined in appearance message" << LL_ENDL; mHoverOffset = LLVector3(0.0, 0.0, 0.0); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index a3f599e2d7..0daf679e8e 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -213,8 +213,6 @@ public: /*virtual*/ LLVector3 getPosAgentFromGlobal(const LLVector3d &position); virtual void updateVisualParams(); - LLVector3 mHoverOffset; - /** Inherited ** ** *******************************************************************************/ @@ -1021,6 +1019,9 @@ protected: // Shared with LLVOAvatarSelf extern const F32 SELF_ADDITIONAL_PRI; extern const S32 MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL; +extern const F32 MAX_HOVER_Z; +extern const F32 MIN_HOVER_Z; + std::string get_sequential_numbered_file_name(const std::string& prefix, const std::string& suffix); void dump_sequential_xml(const std::string outprefix, const LLSD& content); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 6e0c9cb68c..ed560b1c30 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -239,7 +239,8 @@ void LLVOAvatarSelf::initInstance() return; } - mHoverOffset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); + F32 hover_z = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ"); + mHoverOffset = LLVector3(0.0, 0.0, llclamp(hover_z,MIN_HOVER_Z,MAX_HOVER_Z)); LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << mHoverOffset[2] << LL_ENDL; //doPeriodically(output_self_av_texture_diagnostics, 30.0); diff --git a/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml b/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml index 29d06b9b4e..8fc20d28fb 100755 --- a/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml +++ b/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml @@ -23,8 +23,6 @@ follows="top|left" height="15" increment="0.001" - max_val="2" - min_val="-2" initial_value="0.0" label="Height" label_width="60" |