summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llaudiosourcevo.cpp98
-rw-r--r--indra/newview/llaudiosourcevo.h4
-rw-r--r--indra/newview/llconversationview.cpp2
-rw-r--r--indra/newview/llfloatermodelpreview.cpp29
-rw-r--r--indra/newview/llfloatermodelpreview.h4
-rw-r--r--indra/newview/llfloatermodeluploadbase.h2
-rw-r--r--indra/newview/llmeshrepository.cpp4
-rw-r--r--indra/newview/llnetmap.cpp2
-rw-r--r--indra/newview/lloutputmonitorctrl.cpp4
-rw-r--r--indra/newview/llpanelvolume.cpp20
-rw-r--r--indra/newview/llpreviewnotecard.cpp6
-rw-r--r--indra/newview/llsnapshotlivepreview.cpp40
-rw-r--r--indra/newview/lluploadfloaterobservers.h2
-rw-r--r--indra/newview/llviewermessage.cpp5
-rw-r--r--indra/newview/llviewerobject.cpp7
-rw-r--r--indra/newview/llviewerobject.h2
-rw-r--r--indra/newview/llvoavatar.cpp44
-rw-r--r--indra/newview/llvoavatar.h2
-rw-r--r--indra/newview/llworldmapview.cpp2
19 files changed, 191 insertions, 88 deletions
diff --git a/indra/newview/llaudiosourcevo.cpp b/indra/newview/llaudiosourcevo.cpp
index b37aba6c15..4b6c855bde 100644
--- a/indra/newview/llaudiosourcevo.cpp
+++ b/indra/newview/llaudiosourcevo.cpp
@@ -29,8 +29,10 @@
#include "llaudiosourcevo.h"
+#include "llagent.h"
#include "llagentcamera.h"
#include "llmutelist.h"
+#include "llviewercontrol.h"
#include "llviewerparcelmgr.h"
LLAudioSourceVO::LLAudioSourceVO(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, LLViewerObject *objectp)
@@ -54,6 +56,79 @@ void LLAudioSourceVO::setGain(const F32 gain)
mGain = llclamp(gain, 0.f, 1.f);
}
+void LLAudioSourceVO::checkCutOffRadius()
+{
+ if (mSourceMuted // already muted by something, will be recalculated on update()
+ || !mObjectp)
+ {
+ return;
+ }
+
+ F32 cutoff = mObjectp->getSoundCutOffRadius();
+ if (cutoff < 0.1f)
+ {
+ // consider cutoff below 0.1m as off (to avoid near zero comparison)
+ return;
+ }
+
+ LLVector3d pos_global = getPosGlobal();
+ if (!isInCutOffRadius(pos_global, cutoff))
+ {
+ mSourceMuted = true;
+ }
+}
+
+LLVector3d LLAudioSourceVO::getPosGlobal() const
+{
+ if (mObjectp->isAttachment())
+ {
+ LLViewerObject* parent = mObjectp;
+ while (parent && !parent->isAvatar())
+ {
+ parent = (LLViewerObject*)parent->getParent();
+ }
+ if (parent)
+ {
+ return parent->getPositionGlobal();
+ }
+ }
+ else
+ {
+ return mObjectp->getPositionGlobal();
+ }
+ return LLVector3d();
+}
+
+bool LLAudioSourceVO::isInCutOffRadius(const LLVector3d pos_global, const F32 cutoff) const
+{
+ static LLCachedControl<S32> ear_mode(gSavedSettings, "VoiceEarLocation", 0);
+
+ LLVector3d pos_ear;
+
+ switch (ear_mode())
+ {
+ case 0: // camera
+ pos_ear = gAgentCamera.getCameraPositionGlobal();
+ break;
+
+ case 1: // avatar
+ case 2:
+ // voice support 'mixed' in '2' case with agent's position and camera's rotations
+ // but it is not defined in settings and uses camera as default
+ pos_ear = gAgent.getPositionGlobal();
+ break;
+
+ default:
+ pos_ear = gAgentCamera.getCameraPositionGlobal();
+ break;
+ }
+ LLVector3d to_vec = pos_global - pos_ear;
+
+ F32 dist = (F32)to_vec.magVec();
+
+ return dist < cutoff;
+}
+
void LLAudioSourceVO::updateMute()
{
if (!mObjectp || mObjectp->isDead())
@@ -63,26 +138,11 @@ void LLAudioSourceVO::updateMute()
}
bool mute = false;
- LLVector3d pos_global;
-
- if (mObjectp->isAttachment())
- {
- LLViewerObject* parent = mObjectp;
- while (parent && !parent->isAvatar())
- {
- parent = (LLViewerObject*)parent->getParent();
- }
- if (parent)
- {
- pos_global = parent->getPositionGlobal();
- }
- }
- else
- {
- pos_global = mObjectp->getPositionGlobal();
- }
+ LLVector3d pos_global = getPosGlobal();
- if (!LLViewerParcelMgr::getInstance()->canHearSound(pos_global))
+ F32 cutoff = mObjectp->getSoundCutOffRadius();
+ if ((cutoff > 0.1f && !isInCutOffRadius(pos_global, cutoff)) // consider cutoff below 0.1m as off
+ || !LLViewerParcelMgr::getInstance()->canHearSound(pos_global))
{
mute = true;
}
diff --git a/indra/newview/llaudiosourcevo.h b/indra/newview/llaudiosourcevo.h
index f1d8ef4528..672a07f7d3 100644
--- a/indra/newview/llaudiosourcevo.h
+++ b/indra/newview/llaudiosourcevo.h
@@ -41,7 +41,11 @@ public:
/*virtual*/ void update();
/*virtual*/ void setGain(const F32 gain);
+ void checkCutOffRadius();
+
private:
+ LLVector3d getPosGlobal() const;
+ bool isInCutOffRadius(LLVector3d pos_global, const F32 cutoff) const;
void updateMute();
private:
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 0075b62100..60a5204547 100644
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -175,7 +175,7 @@ BOOL LLConversationViewSession::postBuild()
LLAvatarIconCtrl* icon = mItemPanel->getChild<LLAvatarIconCtrl>("avatar_icon");
icon->setVisible(true);
icon->setValue(session->mOtherParticipantID);
- mSpeakingIndicator->setSpeakerId(gAgentID, session->mSessionID, true);
+ mSpeakingIndicator->setSpeakerId(session->mOtherParticipantID, session->mSessionID, true);
mHasArrow = false;
}
break;
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 7705c1a76f..74925caed4 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -433,7 +433,7 @@ void LLFloaterModelPreview::initModelPreview()
mModelPreview = new LLModelPreview(512, 512, this );
mModelPreview->setPreviewTarget(16.f);
mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5));
- mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, _1));
+ mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::modelUpdated, this, _1));
}
void LLFloaterModelPreview::onViewOptionChecked(LLUICtrl* ctrl)
@@ -510,7 +510,8 @@ void LLFloaterModelPreview::onClickCalculateBtn()
mModelPreview->getPreviewAvatar()->showAttachmentOverrides();
}
- mUploadModelUrl.clear();
+ mUploadModelUrl.clear();
+ mModelPhysicsFee.clear();
gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
childGetValue("upload_textures").asBoolean(),
@@ -4439,6 +4440,12 @@ void LLFloaterModelPreview::toggleCalculateButton()
toggleCalculateButton(true);
}
+void LLFloaterModelPreview::modelUpdated(bool calculate_visible)
+{
+ mModelPhysicsFee.clear();
+ toggleCalculateButton(calculate_visible);
+}
+
void LLFloaterModelPreview::toggleCalculateButton(bool visible)
{
mCalculateBtn->setVisible(visible);
@@ -4464,7 +4471,10 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
childSetTextArg("download_weight", "[ST]", tbd);
childSetTextArg("server_weight", "[SIM]", tbd);
childSetTextArg("physics_weight", "[PH]", tbd);
- childSetTextArg("upload_fee", "[FEE]", tbd);
+ if (!mModelPhysicsFee.isMap() || mModelPhysicsFee.emptyMap())
+ {
+ childSetTextArg("upload_fee", "[FEE]", tbd);
+ }
childSetTextArg("price_breakdown", "[STREAMING]", tbd);
childSetTextArg("price_breakdown", "[PHYSICS]", tbd);
childSetTextArg("price_breakdown", "[INSTANCES]", tbd);
@@ -4524,10 +4534,21 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived()
mUploadBtn->setEnabled(isModelUploadAllowed());
}
-void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason)
+void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result)
{
LL_WARNS() << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << LL_ENDL;
doOnIdleOneTime(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, true));
+
+ if (result.has("upload_price"))
+ {
+ mModelPhysicsFee = result;
+ childSetTextArg("upload_fee", "[FEE]", llformat("%d", result["upload_price"].asInteger()));
+ childSetVisible("upload_fee", true);
+ }
+ else
+ {
+ mModelPhysicsFee.clear();
+ }
}
/*virtual*/
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index edc90d1695..1c66570650 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -125,7 +125,7 @@ public:
/*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url);
void handleModelPhysicsFeeReceived();
- /*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason);
+ /*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result);
/*virtual*/ void onModelUploadSuccess();
@@ -208,6 +208,8 @@ private:
void onLoDSourceCommit(S32 lod);
+ void modelUpdated(bool calculate_visible);
+
// Toggles between "Calculate weights & fee" and "Upload" buttons.
void toggleCalculateButton(bool visible);
diff --git a/indra/newview/llfloatermodeluploadbase.h b/indra/newview/llfloatermodeluploadbase.h
index 0d4c834122..721fce059e 100644
--- a/indra/newview/llfloatermodeluploadbase.h
+++ b/indra/newview/llfloatermodeluploadbase.h
@@ -45,7 +45,7 @@ public:
virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
- virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0;
+ virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result) = 0;
virtual void onModelUploadSuccess() {};
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 31e3d408d7..95322cce6d 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2772,7 +2772,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
if (observer)
{
- observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason);
+ observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason, body["error"]);
}
}
else
@@ -2805,7 +2805,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
if (observer)
{
- observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason);
+ observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason, body["error"]);
}
}
}
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 248c361ca4..cb6f3fcf2d 100644
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -354,7 +354,7 @@ void LLNetMap::draw()
LLColor4 color = show_as_friend ? map_avatar_friend_color : map_avatar_color;
- unknown_relative_z = positions[i].mdV[VZ] == COARSEUPDATE_MAX_Z &&
+ unknown_relative_z = positions[i].mdV[VZ] >= COARSEUPDATE_MAX_Z &&
camera_position.mV[VZ] >= COARSEUPDATE_MAX_Z;
LLWorldMapView::drawAvatar(
diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp
index 7f6c065bb9..e9fe493d7e 100644
--- a/indra/newview/lloutputmonitorctrl.cpp
+++ b/indra/newview/lloutputmonitorctrl.cpp
@@ -245,11 +245,11 @@ void LLOutputMonitorCtrl::draw()
// virtual
BOOL LLOutputMonitorCtrl::handleMouseUp(S32 x, S32 y, MASK mask)
{
- if (mSpeakerId != gAgentID && !mShowParticipantsSpeaking)
+ if (mSpeakerId != gAgentID)
{
LLFloaterReg::showInstance("floater_voice_volume", LLSD().with("avatar_id", mSpeakerId));
}
- else if(mShowParticipantsSpeaking)
+ else if (mShowParticipantsSpeaking)
{
LLFloaterReg::showInstance("chat_voice", LLSD());
}
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index 735eaa423d..58bc049338 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -82,8 +82,11 @@
#include <boost/bind.hpp>
-// "Features" Tab
+const F32 DEFAULT_GRAVITY_MULTIPLIER = 1.f;
+const F32 DEFAULT_DENSITY = 1000.f;
+
+// "Features" Tab
BOOL LLPanelVolume::postBuild()
{
// Flexible Objects Parameters
@@ -830,7 +833,7 @@ void LLPanelVolume::onLightSelectTexture(const LLSD& data)
// static
void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
{
- //LLPanelObject* self = (LLPanelObject*) userdata;
+ LLPanelVolume* self = (LLPanelVolume*)userdata;
LLComboBox* box = (LLComboBox*) ctrl;
if (box)
@@ -841,6 +844,19 @@ void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
if (material_name != LEGACY_FULLBRIGHT_DESC)
{
U8 material_code = LLMaterialTable::basic.getMCode(material_name);
+ if (self)
+ {
+ LLViewerObject* objectp = self->mObject;
+ if (objectp)
+ {
+ objectp->setPhysicsGravity(DEFAULT_GRAVITY_MULTIPLIER);
+ objectp->setPhysicsFriction(LLMaterialTable::basic.getFriction(material_code));
+ //currently density is always set to 1000 serverside regardless of chosen material,
+ //actual material density should be used here, if this behavior change
+ objectp->setPhysicsDensity(DEFAULT_DENSITY);
+ objectp->setPhysicsRestitution(LLMaterialTable::basic.getRestitution(material_code));
+ }
+ }
LLSelectMgr::getInstance()->selectionSetMaterial(material_code);
}
}
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp
index 1533a27469..2f534ac245 100644
--- a/indra/newview/llpreviewnotecard.cpp
+++ b/indra/newview/llpreviewnotecard.cpp
@@ -367,6 +367,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
previewEditor->makePristine();
BOOL modifiable = preview->canModify(preview->mObjectID, preview->getItem());
preview->setEnabled(modifiable);
+ preview->syncExternal();
preview->mAssetStatus = PREVIEW_ASSET_LOADED;
}
else
@@ -503,10 +504,6 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem, bool sync)
}
editor->makePristine();
- if (sync)
- {
- syncExternal();
- }
const LLInventoryItem* item = getItem();
// save it out to database
if (item)
@@ -755,6 +752,7 @@ void LLPreviewNotecard::openInExternalEditor()
// Start watching file changes.
mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLPreviewNotecard::onExternalChange, this, _1));
+ mLiveFile->ignoreNextUpdate();
mLiveFile->addToEventTimer();
// Open it in external editor.
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index f5fea9dece..0bba495174 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -65,6 +65,7 @@ F32 SHINE_WIDTH = 0.6f;
F32 SHINE_OPACITY = 0.3f;
F32 FALL_TIME = 0.6f;
S32 BORDER_WIDTH = 6;
+S32 TOP_PANEL_HEIGHT = 30;
const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512
@@ -295,8 +296,8 @@ void LLSnapshotLivePreview::draw()
F32 uv_width = isImageScaled() ? 1.f : llmin((F32)getWidth() / (F32)getCurrentImage()->getWidth(), 1.f);
F32 uv_height = isImageScaled() ? 1.f : llmin((F32)getHeight() / (F32)getCurrentImage()->getHeight(), 1.f);
gGL.pushMatrix();
- {
- gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f);
+ {
+ gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom + TOP_PANEL_HEIGHT, 0.f);
gGL.begin(LLRender::QUADS);
{
gGL.texCoord2f(uv_width, uv_height);
@@ -348,14 +349,15 @@ void LLSnapshotLivePreview::draw()
F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME);
// draw "shine" effect
- LLLocalClipRect clip(getLocalRect());
+ LLRect local_rect(0, getRect().getHeight() + TOP_PANEL_HEIGHT, getRect().getWidth(), 0);
+ LLLocalClipRect clip(local_rect);
{
// draw diagonal stripe with gradient that passes over screen
S32 x1 = gViewerWindow->getWindowWidthScaled() * ll_round((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f)));
S32 x2 = x1 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
S32 x3 = x2 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
S32 y1 = 0;
- S32 y2 = gViewerWindow->getWindowHeightScaled();
+ S32 y2 = gViewerWindow->getWindowHeightScaled() + TOP_PANEL_HEIGHT;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.begin(LLRender::QUADS);
@@ -385,36 +387,6 @@ void LLSnapshotLivePreview::draw()
}
}
- // draw framing rectangle
- {
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- gGL.color4f(1.f, 1.f, 1.f, 1.f);
- const LLRect& outline_rect = getImageRect();
- gGL.begin(LLRender::QUADS);
- {
- gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
- gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
- gGL.vertex2i(outline_rect.mRight, outline_rect.mTop);
- gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop);
-
- gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom);
- gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom);
- gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
- gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
-
- gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop);
- gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom);
- gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
- gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
-
- gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom);
- gGL.vertex2i(outline_rect.mRight, outline_rect.mTop);
- gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
- gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
- }
- gGL.end();
- }
-
// draw old image dropping away
if (mFallAnimTimer.getStarted())
{
diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h
index 15c3dad38e..77e950a1c9 100644
--- a/indra/newview/lluploadfloaterobservers.h
+++ b/indra/newview/lluploadfloaterobservers.h
@@ -53,7 +53,7 @@ public:
virtual ~LLWholeModelFeeObserver() {}
virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
- virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0;
+ virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result) = 0;
LLHandle<LLWholeModelFeeObserver> getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; }
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 5b9c39af9f..3998a6af15 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -374,6 +374,11 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_
LL_INFOS("Messaging") << "give_money(" << uuid << "," << amount << ")"<< LL_ENDL;
if(can_afford_transaction(amount))
{
+ if (uuid.isNull())
+ {
+ LL_WARNS() << "Failed to send L$ gift to to Null UUID." << LL_ENDL;
+ return;
+ }
// gStatusBar->debitBalance(amount);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_MoneyTransferRequest);
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 8d7bfa42ed..bc0a151670 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -268,6 +268,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
mData(NULL),
mAudioSourcep(NULL),
mAudioGain(1.f),
+ mSoundCutOffRadius(0.f),
mAppAngle(0.f),
mPixelArea(1024.f),
mInventory(NULL),
@@ -1245,6 +1246,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
LLUUID audio_uuid;
LLUUID owner_id; // only valid if audio_uuid or particle system is not null
F32 gain;
+ F32 cutoff;
U8 sound_flags;
mesgsys->getU32Fast( _PREHASH_ObjectData, _PREHASH_CRC, crc, block_num);
@@ -1253,6 +1255,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// HACK: Owner id only valid if non-null sound id or particle system
mesgsys->getUUIDFast(_PREHASH_ObjectData, _PREHASH_OwnerID, owner_id, block_num );
mesgsys->getF32Fast( _PREHASH_ObjectData, _PREHASH_Gain, gain, block_num );
+ mesgsys->getF32Fast( _PREHASH_ObjectData, _PREHASH_Radius, cutoff, block_num );
mesgsys->getU8Fast( _PREHASH_ObjectData, _PREHASH_Flags, sound_flags, block_num );
mesgsys->getU8Fast( _PREHASH_ObjectData, _PREHASH_Material, material, block_num );
mesgsys->getU8Fast( _PREHASH_ObjectData, _PREHASH_ClickAction, click_action, block_num);
@@ -1261,6 +1264,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_ObjectData, data, length, block_num, MAX_OBJECT_BINARY_DATA_SIZE);
mTotalCRC = crc;
+ mSoundCutOffRadius = cutoff;
// Owner ID used for sound muting or particle system muting
setAttachedSound(audio_uuid, owner_id, gain, sound_flags);
@@ -1957,6 +1961,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
}
mTotalCRC = crc;
+ mSoundCutOffRadius = cutoff;
setAttachedSound(sound_uuid, owner_id, gain, sound_flags);
@@ -5912,6 +5917,8 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow
if( gAgent.canAccessMaturityAtGlobal(this->getPositionGlobal()) )
{
//LL_INFOS() << "Playing attached sound " << audio_uuid << LL_ENDL;
+ // recheck cutoff radius in case this update was an object-update with new value
+ mAudioSourcep->checkCutOffRadius();
mAudioSourcep->play(audio_uuid);
}
}
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index e9ae26939a..03c5403a1e 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -403,6 +403,7 @@ public:
// Owner id is this object's owner
void setAttachedSound(const LLUUID &audio_uuid, const LLUUID& owner_id, const F32 gain, const U8 flags);
void adjustAudioGain(const F32 gain);
+ F32 getSoundCutOffRadius() const { return mSoundCutOffRadius; }
void clearAttachedSound() { mAudioSourcep = NULL; }
// Create if necessary
@@ -790,6 +791,7 @@ protected:
LLPointer<LLViewerPartSourceScript> mPartSourcep; // Particle source associated with this object.
LLAudioSourceVO* mAudioSourcep;
F32 mAudioGain;
+ F32 mSoundCutOffRadius;
F32 mAppAngle; // Apparent visual arc in degrees
F32 mPixelArea; // Apparent area in pixels
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index a974c66ee4..e42a7269b4 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -883,8 +883,9 @@ BOOL LLVOAvatar::hasGray() const
S32 LLVOAvatar::getRezzedStatus() const
{
if (getIsCloud()) return 0;
- if (isFullyTextured() && allBakedTexturesCompletelyDownloaded()) return 3;
- if (isFullyTextured()) return 2;
+ bool textured = isFullyTextured();
+ if (textured && allBakedTexturesCompletelyDownloaded()) return 3;
+ if (textured) return 2;
llassert(hasGray());
return 1; // gray
}
@@ -2045,8 +2046,10 @@ void LLVOAvatar::resetSkeleton(bool reset_animations)
LL_ERRS() << "Error resetting skeleton" << LL_ENDL;
}
- // Reset attachment points (buildSkeleton only does bones and CVs)
- bool ignore_hud_joints = true;
+ // Reset attachment points
+ // BuildSkeleton only does bones and CVs but we still need to reinit huds
+ // since huds can be animated.
+ bool ignore_hud_joints = !isSelf();
initAttachmentPoints(ignore_hud_joints);
// Fix up collision volumes
@@ -6576,7 +6579,7 @@ void LLVOAvatar::initAttachmentPoints(bool ignore_hud_joints)
LLAvatarXmlInfo::LLAvatarAttachmentInfo *info = *iter;
if (info->mIsHUDAttachment && (!isSelf() || ignore_hud_joints))
{
- //don't process hud joint for other avatars, or when doing a skeleton reset.
+ //don't process hud joint for other avatars.
continue;
}
@@ -7614,14 +7617,13 @@ bool LLVOAvatar::getIsCloud() const
);
}
-void LLVOAvatar::updateRezzedStatusTimers()
+void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)
{
// State machine for rezzed status. Statuses are -1 on startup, 0
// = cloud, 1 = gray, 2 = downloading, 3 = full.
// Purpose is to collect time data for each it takes avatar to reach
// various loading landmarks: gray, textured (partial), textured fully.
- S32 rez_status = getRezzedStatus();
if (rez_status != mLastRezzedStatus)
{
LL_DEBUGS("Avatar") << avString() << "rez state change: " << mLastRezzedStatus << " -> " << rez_status << LL_ENDL;
@@ -7791,8 +7793,13 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse
// returns true if the value has changed.
BOOL LLVOAvatar::updateIsFullyLoaded()
{
- const bool loading = getIsCloud();
- updateRezzedStatusTimers();
+ S32 rez_status = getRezzedStatus();
+ bool loading = getIsCloud();
+ if (mFirstFullyVisible && !mIsControlAvatar && rez_status < 3)
+ {
+ loading = ((rez_status < 2) || !isFullyBaked());
+ }
+ updateRezzedStatusTimers(rez_status);
updateRuthTimer(loading);
return processFullyLoadedChange(loading);
}
@@ -7828,13 +7835,22 @@ void LLVOAvatar::updateRuthTimer(bool loading)
BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
{
- // we wait a little bit before giving the all clear,
- // to let textures settle down
- const F32 PAUSE = 1.f;
+ // We wait a little bit before giving the 'all clear', to let things to
+ // settle down (models to snap into place, textures to get first packets)
+ const F32 LOADED_DELAY = 1.f;
+ const F32 FIRST_USE_DELAY = 3.f;
+
if (loading)
mFullyLoadedTimer.reset();
-
- mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > PAUSE);
+
+ if (mFirstFullyVisible)
+ {
+ mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > FIRST_USE_DELAY);
+ }
+ else
+ {
+ mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > LOADED_DELAY);
+ }
if (!mPreviousFullyLoaded && !loading && mFullyLoaded)
{
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 00dccc5d12..e352a6c1fa 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -348,7 +348,7 @@ public:
BOOL isFullyTextured() const;
BOOL hasGray() const;
S32 getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = textured, 3 = textured and fully downloaded.
- void updateRezzedStatusTimers();
+ void updateRezzedStatusTimers(S32 status);
S32 mLastRezzedStatus;
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index 86249badaa..853da80e9e 100644
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -1154,7 +1154,7 @@ void LLWorldMapView::drawAvatar(F32 x_pixels,
{
const F32 HEIGHT_THRESHOLD = 7.f;
LLUIImagePtr dot_image = sAvatarLevelImage;
- if (unknown_relative_z)
+ if (unknown_relative_z && llabs(relative_z) > HEIGHT_THRESHOLD)
{
dot_image = sAvatarUnknownImage;
}