aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/newview/app_settings/settings.xml11
-rw-r--r--linden/indra/newview/llglsandbox.cpp22
-rw-r--r--linden/indra/newview/llhudeffectlookat.cpp32
3 files changed, 42 insertions, 23 deletions
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 @@
469 <key>Value</key> 469 <key>Value</key>
470 <integer>0</integer> 470 <integer>0</integer>
471 </map> 471 </map>
472 <key>PrivatePointAtTarget</key>
473 <map>
474 <key>Comment</key>
475 <string>If true, viewer won't show the editing arm motion.</string>
476 <key>Persist</key>
477 <integer>1</integer>
478 <key>Type</key>
479 <string>Boolean</string>
480 <key>Value</key>
481 <integer>0</integer>
482 </map>
472 <key>SavedRenderFarClip</key> 483 <key>SavedRenderFarClip</key>
473 <map> 484 <map>
474 <key>Comment</key> 485 <key>Comment</key>
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 @@
71 71
72BOOL LLAgent::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVector3 position) 72BOOL LLAgent::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVector3 position)
73{ 73{
74 if (object && target_type != LOOKAT_TARGET_NONE && gSavedSettings.getBOOL("PrivateLookAtTarget"))
75 {
76 target_type = LOOKAT_TARGET_NONE;
77 object = mAvatarObject;
78 position.clearVec();
79 LLViewerObject* source_obj = mLookAt->getSourceObject();
80 if (source_obj)
81 {
82 mLookAt->setTargetObject(source_obj);
83 }
84 }
85
86 if(object && object->isAttachment()) 74 if(object && object->isAttachment())
87 { 75 {
88 LLViewerObject* parent = object; 76 LLViewerObject* parent = object;
@@ -109,18 +97,12 @@ BOOL LLAgent::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVecto
109BOOL LLAgent::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position) 97BOOL LLAgent::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position)
110{ 98{
111 // disallow pointing at attachments and avatars 99 // disallow pointing at attachments and avatars
112 if (object && (object->isAttachment() || object->isAvatar())) 100 bool private_pointat = gSavedSettings.getBOOL("PrivatePointAtTarget");//this is the arm motion
101 if (object && (object->isAttachment() || object->isAvatar() || private_pointat))
113 { 102 {
114 return FALSE; 103 return FALSE;
115 } 104 }
116 105
117 if (object && target_type != POINTAT_TARGET_NONE && gSavedSettings.getBOOL("PrivateLookAtTarget"))
118 {
119 target_type = POINTAT_TARGET_NONE;
120 object = NULL;
121 position.clearVec();
122 }
123
124 if(!mPointAt || mPointAt->isDead()) 106 if(!mPointAt || mPointAt->isDead())
125 { 107 {
126 mPointAt = (LLHUDEffectPointAt *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINTAT); 108 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)
287 287
288 // pack both target object and position 288 // pack both target object and position
289 // position interpreted as offset if target object is non-null 289 // position interpreted as offset if target object is non-null
290 ELookAtType target_type = mTargetType;
291 LLVector3d target_offset_global = mTargetOffsetGlobal;
292 LLViewerObject* target_object = (LLViewerObject*)mTargetObject;
293
294 LLViewerObject* source_object = (LLViewerObject*)mSourceObject;
295 LLVOAvatar* source_avatar = NULL;
296
297 if (source_object && source_object->isAvatar()) //strange enough that non-avatar objects try to send a lookat message
298 {
299 source_avatar = (LLVOAvatar*)source_object;
300 }
301
302 if (source_avatar)
303 {
304 bool is_self = source_avatar->isSelf(); //more strange if it is not self.
305 bool is_private = gSavedSettings.getBOOL("PrivateLookAtTarget");
306
307 if (is_private && is_self)
308 {
309 //this mimicks "do nothing"
310 target_type = LOOKAT_TARGET_AUTO_LISTEN;
311 target_offset_global.setVec(2.5, 0.0, 0.0);
312 target_object = mSourceObject;
313 }
314 }
315
290 if (mTargetObject) 316 if (mTargetObject)
291 { 317 {
292 htonmemcpy(&(packed_data[TARGET_OBJECT]), mTargetObject->mID.mData, MVT_LLUUID, 16); 318 htonmemcpy(&(packed_data[TARGET_OBJECT]), target_object->mID.mData, MVT_LLUUID, 16);
293 } 319 }
294 else 320 else
295 { 321 {
296 htonmemcpy(&(packed_data[TARGET_OBJECT]), LLUUID::null.mData, MVT_LLUUID, 16); 322 htonmemcpy(&(packed_data[TARGET_OBJECT]), LLUUID::null.mData, MVT_LLUUID, 16);
297 } 323 }
298 324
299 htonmemcpy(&(packed_data[TARGET_POS]), mTargetOffsetGlobal.mdV, MVT_LLVector3d, 24); 325 htonmemcpy(&(packed_data[TARGET_POS]), target_offset_global.mdV, MVT_LLVector3d, 24);
300 326
301 U8 lookAtTypePacked = (U8)mTargetType; 327 U8 lookAtTypePacked = (U8)target_type;
302 328
303 htonmemcpy(&(packed_data[LOOKAT_TYPE]), &lookAtTypePacked, MVT_U8, 1); 329 htonmemcpy(&(packed_data[LOOKAT_TYPE]), &lookAtTypePacked, MVT_U8, 1);
304 330