aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llagent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llagent.cpp')
-rw-r--r--linden/indra/newview/llagent.cpp62
1 files changed, 40 insertions, 22 deletions
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index 307ab6f..3f6ab4f 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -61,6 +61,7 @@
61#include "llface.h" 61#include "llface.h"
62#include "llfirstuse.h" 62#include "llfirstuse.h"
63#include "llfloater.h" 63#include "llfloater.h"
64#include "llfloateractivespeakers.h"
64#include "llfloateravatarinfo.h" 65#include "llfloateravatarinfo.h"
65#include "llfloaterbuildoptions.h" 66#include "llfloaterbuildoptions.h"
66#include "llfloaterchat.h" 67#include "llfloaterchat.h"
@@ -117,6 +118,7 @@
117#include "pipeline.h" 118#include "pipeline.h"
118#include "roles_constants.h" 119#include "roles_constants.h"
119#include "viewer.h" 120#include "viewer.h"
121#include "llvoiceclient.h"
120 122
121// Ventrella 123// Ventrella
122#include "llfollowcam.h" 124#include "llfollowcam.h"
@@ -346,7 +348,7 @@ LLAgent::LLAgent()
346 mEffectColor(0.f, 1.f, 1.f, 1.f), 348 mEffectColor(0.f, 1.f, 1.f, 1.f),
347 mHaveHomePosition(FALSE), 349 mHaveHomePosition(FALSE),
348 mHomeRegionHandle( 0 ), 350 mHomeRegionHandle( 0 ),
349 mNearChatRadius(10.f), 351 mNearChatRadius(CHAT_NORMAL_RADIUS / 2.f),
350 mGodLevel( GOD_NOT ), 352 mGodLevel( GOD_NOT ),
351 353
352 354
@@ -2844,7 +2846,7 @@ void LLAgent::endAnimationUpdateUI()
2844 gMorphView->setVisible(FALSE); 2846 gMorphView->setVisible(FALSE);
2845 } 2847 }
2846 2848
2847 gIMView->setFloaterOpen( FALSE ); 2849 gIMMgr->setFloaterOpen( FALSE );
2848 gConsole->setVisible( TRUE ); 2850 gConsole->setVisible( TRUE );
2849 2851
2850 if (mAvatarObject) 2852 if (mAvatarObject)
@@ -3259,6 +3261,19 @@ void LLAgent::updateCamera()
3259 setLookAt(LOOKAT_TARGET_FOCUS, NULL, mCameraPositionAgent); 3261 setLookAt(LOOKAT_TARGET_FOCUS, NULL, mCameraPositionAgent);
3260 } 3262 }
3261 3263
3264 // Send the camera position to the spatialized voice system.
3265 if(gVoiceClient && getRegion())
3266 {
3267 LLMatrix3 rot;
3268 rot.setRows(gCamera->getAtAxis(), gCamera->getLeftAxis (), gCamera->getUpAxis());
3269
3270 // MBW -- XXX -- Setting velocity to 0 for now. May figure it out later...
3271 gVoiceClient->setCameraPosition(
3272 getRegion()->getPosGlobalFromRegion(gCamera->getOrigin()),// position
3273 LLVector3::zero, // velocity
3274 rot); // rotation matrix
3275 }
3276
3262 // update the travel distance stat 3277 // update the travel distance stat
3263 // this isn't directly related to the camera 3278 // this isn't directly related to the camera
3264 // but this seemed like the best place to do this 3279 // but this seemed like the best place to do this
@@ -3269,7 +3284,7 @@ void LLAgent::updateCamera()
3269 mDistanceTraveled += delta.magVec(); 3284 mDistanceTraveled += delta.magVec();
3270 } 3285 }
3271 mLastPositionGlobal = global_pos; 3286 mLastPositionGlobal = global_pos;
3272 3287
3273 if (LLVOAvatar::sVisibleInFirstPerson && mAvatarObject.notNull() && !mAvatarObject->mIsSitting && cameraMouselook()) 3288 if (LLVOAvatar::sVisibleInFirstPerson && mAvatarObject.notNull() && !mAvatarObject->mIsSitting && cameraMouselook())
3274 { 3289 {
3275 LLVector3 head_pos = mAvatarObject->mHeadp->getWorldPosition() + 3290 LLVector3 head_pos = mAvatarObject->mHeadp->getWorldPosition() +
@@ -4465,18 +4480,23 @@ void LLAgent::setFocusOnAvatar(BOOL focus_on_avatar, BOOL animate)
4465//----------------------------------------------------------------------------- 4480//-----------------------------------------------------------------------------
4466// heardChat() 4481// heardChat()
4467//----------------------------------------------------------------------------- 4482//-----------------------------------------------------------------------------
4468void LLAgent::heardChat(const LLChat& chat) 4483void LLAgent::heardChat(const LLUUID& id)
4469{ 4484{
4470 if (chat.mChatType == CHAT_TYPE_START 4485 // log text and voice chat to speaker mgr
4471 || chat.mChatType == CHAT_TYPE_STOP) 4486 // for keeping track of active speakers, etc.
4487 gLocalSpeakerMgr->speakerChatted(id);
4488
4489 // don't respond to your own voice
4490 if (id == getID()) return;
4491
4492 if (ll_rand(2) == 0)
4472 { 4493 {
4473 return; 4494 LLViewerObject *chatter = gObjectList.findObject(mLastChatterID);
4474 } 4495 setLookAt(LOOKAT_TARGET_AUTO_LISTEN, chatter, LLVector3::zero);
4496 }
4475 4497
4476 mLastChatterID = chat.mFromID; 4498 mLastChatterID = id;
4477 mChatTimer.reset(); 4499 mChatTimer.reset();
4478
4479 mNearChatRadius = CHAT_NORMAL_RADIUS / 2.f;
4480} 4500}
4481 4501
4482//----------------------------------------------------------------------------- 4502//-----------------------------------------------------------------------------
@@ -5068,14 +5088,6 @@ void LLAgent::initOriginGlobal(const LLVector3d &origin_global)
5068 5088
5069void update_group_floaters(const LLUUID& group_id) 5089void update_group_floaters(const LLUUID& group_id)
5070{ 5090{
5071 // *HACK: added to do a live update of the groups floater if it is
5072 // open.
5073 LLFloaterGroups* fg = LLFloaterGroups::getInstance(gAgent.getID());
5074 if(fg)
5075 {
5076 fg->reset();
5077 }
5078
5079 LLFloaterGroupInfo::refreshGroup(group_id); 5091 LLFloaterGroupInfo::refreshGroup(group_id);
5080 5092
5081 // update avatar info 5093 // update avatar info
@@ -5085,10 +5097,10 @@ void update_group_floaters(const LLUUID& group_id)
5085 fa->resetGroupList(); 5097 fa->resetGroupList();
5086 } 5098 }
5087 5099
5088 if (gIMView) 5100 if (gIMMgr)
5089 { 5101 {
5090 // update the talk view 5102 // update the talk view
5091 gIMView->refresh(); 5103 gIMMgr->refresh();
5092 } 5104 }
5093} 5105}
5094 5106
@@ -5179,6 +5191,7 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
5179 if (need_floater_update) 5191 if (need_floater_update)
5180 { 5192 {
5181 update_group_floaters(group.mID); 5193 update_group_floaters(group.mID);
5194 gAgent.fireEvent(new LLEvent(&gAgent, "new group"), "");
5182 } 5195 }
5183 } 5196 }
5184 5197
@@ -5508,6 +5521,11 @@ bool LLAgent::teleportCore(bool is_local)
5508 gAgent.setTeleportState( LLAgent::TELEPORT_START ); 5521 gAgent.setTeleportState( LLAgent::TELEPORT_START );
5509 } 5522 }
5510 make_ui_sound("UISndTeleportOut"); 5523 make_ui_sound("UISndTeleportOut");
5524
5525 // MBW -- Let the voice client know a teleport has begun so it can leave the existing channel.
5526 // This was breaking the case of teleporting within a single sim. Backing it out for now.
5527// gVoiceClient->leaveChannel();
5528
5511 return true; 5529 return true;
5512} 5530}
5513 5531
@@ -6770,7 +6788,7 @@ void LLAgent::removeWearable( EWearableType type )
6770 if( old_wearable->isDirty() ) 6788 if( old_wearable->isDirty() )
6771 { 6789 {
6772 // Bring up view-modal dialog: Save changes? Yes, No, Cancel 6790 // Bring up view-modal dialog: Save changes? Yes, No, Cancel
6773 gViewerWindow->alertXml("WearableSave", LLAgent::onRemoveWearableDialog, (void*)(S32)type ); 6791 gViewerWindow->alertXml("WearableSave", LLAgent::onRemoveWearableDialog, (void*)type );
6774 return; 6792 return;
6775 } 6793 }
6776 else 6794 else