From 7c21ea38747046047323505c1c5e948e4297c79c Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Thu, 29 Jul 2010 00:52:54 +0200 Subject: revamp a) privatelookattarget + b) privatepointattarget a) grey crosshair 2.5m in front b) just don't show the editing motion --- linden/indra/newview/app_settings/settings.xml | 11 +++++++++ linden/indra/newview/llglsandbox.cpp | 22 ++---------------- linden/indra/newview/llhudeffectlookat.cpp | 32 +++++++++++++++++++++++--- 3 files changed, 42 insertions(+), 23 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 25474a7..1f5c7b2 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -469,6 +469,17 @@ Value 0 + PrivatePointAtTarget + + Comment + If true, viewer won't show the editing arm motion. + Persist + 1 + Type + Boolean + Value + 0 + SavedRenderFarClip Comment diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp index e9077a9..3acfbf3 100644 --- a/linden/indra/newview/llglsandbox.cpp +++ b/linden/indra/newview/llglsandbox.cpp @@ -71,18 +71,6 @@ BOOL LLAgent::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVector3 position) { - if (object && target_type != LOOKAT_TARGET_NONE && gSavedSettings.getBOOL("PrivateLookAtTarget")) - { - target_type = LOOKAT_TARGET_NONE; - object = mAvatarObject; - position.clearVec(); - LLViewerObject* source_obj = mLookAt->getSourceObject(); - if (source_obj) - { - mLookAt->setTargetObject(source_obj); - } - } - if(object && object->isAttachment()) { LLViewerObject* parent = object; @@ -109,18 +97,12 @@ BOOL LLAgent::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVecto BOOL LLAgent::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position) { // disallow pointing at attachments and avatars - if (object && (object->isAttachment() || object->isAvatar())) + bool private_pointat = gSavedSettings.getBOOL("PrivatePointAtTarget");//this is the arm motion + if (object && (object->isAttachment() || object->isAvatar() || private_pointat)) { return FALSE; } - if (object && target_type != POINTAT_TARGET_NONE && gSavedSettings.getBOOL("PrivateLookAtTarget")) - { - target_type = POINTAT_TARGET_NONE; - object = NULL; - position.clearVec(); - } - if(!mPointAt || mPointAt->isDead()) { mPointAt = (LLHUDEffectPointAt *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINTAT); diff --git a/linden/indra/newview/llhudeffectlookat.cpp b/linden/indra/newview/llhudeffectlookat.cpp index 60b2b89..1c24e7d 100644 --- a/linden/indra/newview/llhudeffectlookat.cpp +++ b/linden/indra/newview/llhudeffectlookat.cpp @@ -287,18 +287,44 @@ void LLHUDEffectLookAt::packData(LLMessageSystem *mesgsys) // pack both target object and position // position interpreted as offset if target object is non-null + ELookAtType target_type = mTargetType; + LLVector3d target_offset_global = mTargetOffsetGlobal; + LLViewerObject* target_object = (LLViewerObject*)mTargetObject; + + LLViewerObject* source_object = (LLViewerObject*)mSourceObject; + LLVOAvatar* source_avatar = NULL; + + if (source_object && source_object->isAvatar()) //strange enough that non-avatar objects try to send a lookat message + { + source_avatar = (LLVOAvatar*)source_object; + } + + if (source_avatar) + { + bool is_self = source_avatar->isSelf(); //more strange if it is not self. + bool is_private = gSavedSettings.getBOOL("PrivateLookAtTarget"); + + if (is_private && is_self) + { + //this mimicks "do nothing" + target_type = LOOKAT_TARGET_AUTO_LISTEN; + target_offset_global.setVec(2.5, 0.0, 0.0); + target_object = mSourceObject; + } + } + if (mTargetObject) { - htonmemcpy(&(packed_data[TARGET_OBJECT]), mTargetObject->mID.mData, MVT_LLUUID, 16); + htonmemcpy(&(packed_data[TARGET_OBJECT]), target_object->mID.mData, MVT_LLUUID, 16); } else { htonmemcpy(&(packed_data[TARGET_OBJECT]), LLUUID::null.mData, MVT_LLUUID, 16); } - htonmemcpy(&(packed_data[TARGET_POS]), mTargetOffsetGlobal.mdV, MVT_LLVector3d, 24); + htonmemcpy(&(packed_data[TARGET_POS]), target_offset_global.mdV, MVT_LLVector3d, 24); - U8 lookAtTypePacked = (U8)mTargetType; + U8 lookAtTypePacked = (U8)target_type; htonmemcpy(&(packed_data[LOOKAT_TYPE]), &lookAtTypePacked, MVT_U8, 1); -- cgit v1.1