diff options
author | Armin Weatherwax | 2010-07-29 00:52:54 +0200 |
---|---|---|
committer | Jacek Antonelli | 2010-08-01 15:59:32 -0500 |
commit | 7c21ea38747046047323505c1c5e948e4297c79c (patch) | |
tree | d5240f4d9b3a3764c795f4111e03c328aa09766a /linden/indra/newview/llhudeffectlookat.cpp | |
parent | Made the LightShare preference behave like the other preferences. (diff) | |
download | meta-impy-7c21ea38747046047323505c1c5e948e4297c79c.zip meta-impy-7c21ea38747046047323505c1c5e948e4297c79c.tar.gz meta-impy-7c21ea38747046047323505c1c5e948e4297c79c.tar.bz2 meta-impy-7c21ea38747046047323505c1c5e948e4297c79c.tar.xz |
revamp a) privatelookattarget + b) privatepointattarget
a) grey crosshair 2.5m in front
b) just don't show the editing motion
Diffstat (limited to 'linden/indra/newview/llhudeffectlookat.cpp')
-rw-r--r-- | linden/indra/newview/llhudeffectlookat.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
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 | ||