Revert "THE BIGGIE."

This reverts commit ec55705bdd.

Conflicts:

	indra/newview/ascentprefsvan.cpp
	indra/newview/llinventorybridge.cpp
	indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml
This commit is contained in:
Siana Gearz
2010-10-18 18:27:09 +02:00
parent 49cb86adae
commit 5a67fcd623
48 changed files with 7185 additions and 8544 deletions

View File

@@ -1643,32 +1643,27 @@ void LLVOAvatar::getSpatialExtents(LLVector3& newMin, LLVector3& newMax)
continue ;
}
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
LLViewerObject* object = attachment->getObject();
if (object && !object->isHUDAttachment())
{
const LLViewerObject* attached_object = (*attachment_iter);
if (attached_object && !attached_object->isHUDAttachment())
LLDrawable* drawable = object->mDrawable;
if (drawable)
{
LLDrawable* drawable = attached_object->mDrawable;
if (drawable)
LLSpatialBridge* bridge = drawable->getSpatialBridge();
if (bridge)
{
LLSpatialBridge* bridge = drawable->getSpatialBridge();
if (bridge)
const LLVector3* ext = bridge->getSpatialExtents();
LLVector3 distance = (ext[1] - ext[0]);
// Only add the prim to spatial extents calculations if it isn't a megaprim.
// max_attachment_span calculated at the start of the function
// (currently 5 times our max prim size)
if (distance.mV[0] < max_attachment_span
&& distance.mV[1] < max_attachment_span
&& distance.mV[2] < max_attachment_span)
{
const LLVector3* ext = bridge->getSpatialExtents();
LLVector3 distance = (ext[1] - ext[0]);
// Only add the prim to spatial extents calculations if it isn't a megaprim.
// max_attachment_span calculated at the start of the function
// (currently 5 times our max prim size)
if (distance.mV[0] < max_attachment_span
&& distance.mV[1] < max_attachment_span
&& distance.mV[2] < max_attachment_span)
{
update_min_max(newMin,newMax,ext[0]);
update_min_max(newMin,newMax,ext[1]);
}
update_min_max(newMin,newMax,ext[0]);
update_min_max(newMin,newMax,ext[1]);
}
}
}
@@ -3011,32 +3006,30 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
{
attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
LLViewerObject *attached_object = attachment->getObject();
BOOL visibleAttachment = visible || (attached_object &&
!(attached_object->mDrawable->getSpatialBridge() &&
attached_object->mDrawable->getSpatialBridge()->getRadius() < 2.0));
if (visibleAttachment && attached_object && !attached_object->isDead() && attachment->getValid())
{
LLViewerObject* attached_object = (*attachment_iter);
BOOL visibleAttachment = visible || (attached_object &&
!(attached_object->mDrawable->getSpatialBridge() &&
attached_object->mDrawable->getSpatialBridge()->getRadius() < 2.0));
if (visibleAttachment && attached_object && !attached_object->isDead() && attachment->getValid())
{
// if selecting any attachments, update all of them as non-damped
if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() && LLSelectMgr::getInstance()->getSelection()->isAttachment())
{
gPipeline.updateMoveNormalAsync(attached_object->mDrawable);
}
else
{
gPipeline.updateMoveDampedAsync(attached_object->mDrawable);
}
LLSpatialBridge* bridge = attached_object->mDrawable->getSpatialBridge();
if (bridge)
{
gPipeline.updateMoveNormalAsync(bridge);
}
attached_object->updateText();
// if selecting any attachments, update all of them as non-damped
if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() && LLSelectMgr::getInstance()->getSelection()->isAttachment())
{
gPipeline.updateMoveNormalAsync(attached_object->mDrawable);
}
else
{
gPipeline.updateMoveDampedAsync(attached_object->mDrawable);
}
LLSpatialBridge* bridge = attached_object->mDrawable->getSpatialBridge();
if (bridge)
{
gPipeline.updateMoveNormalAsync(bridge);
}
attached_object->updateText();
}
}
}
@@ -4908,24 +4901,19 @@ void LLVOAvatar::updateVisibility()
/*llinfos << "SPA: " << sel_pos_agent << llendl;
llinfos << "WPA: " << wrist_right_pos_agent << llendl;*/
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end(); iter++)
iter != mAttachmentPoints.end(); )
{
LLViewerJointAttachment* attachment = iter->second;
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
if (attachment->getObject())
{
if (LLViewerObject *attached_object = (*attachment_iter))
if(attachment->getObject()->mDrawable->isVisible())
{
if (attached_object->mDrawable->isVisible())
{
llinfos << attachment->getName() << " visible" << llendl;
}
else
{
llinfos << attachment->getName() << " not visible at " << mDrawable->getWorldPosition() << " and radius " << mDrawable->getRadius() << llendl;
}
llinfos << attachment->getName() << " visible" << llendl;
}
else
{
llinfos << attachment->getName() << " not visible at " << mDrawable->getWorldPosition() << " and radius " << mDrawable->getRadius() << llendl;
}
}
}
@@ -7068,13 +7056,12 @@ void LLVOAvatar::requestLayerSetUpdate(ETextureIndex index )
}
}
BOOL LLVOAvatar::setParent(LLViewerObject* parent)
void LLVOAvatar::setParent(LLViewerObject* parent)
{
BOOL ret ;
if (parent == NULL)
{
getOffObject();
ret = LLViewerObject::setParent(parent);
LLViewerObject::setParent(parent);
if (isSelf())
{
gAgent.resetCamera();
@@ -7082,18 +7069,13 @@ BOOL LLVOAvatar::setParent(LLViewerObject* parent)
}
else
{
ret = LLViewerObject::setParent(parent);
if (ret)
{
sitOnObject(parent);
}
}
return ret ;
LLViewerObject::setParent(parent);
sitOnObject(parent);
}
}
void LLVOAvatar::addChild(LLViewerObject *childp)
{
childp->extractAttachmentItemID(); // find the inventory item this object is associated with.
LLViewerObject::addChild(childp);
if (childp->mDrawable)
{
@@ -7125,20 +7107,11 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi
{
S32 attachmentID = ATTACHMENT_ID_FROM_STATE(viewer_object->getState());
// This should never happen unless the server didn't process the attachment point
// correctly, but putting this check in here to be safe.
if (attachmentID & ATTACHMENT_ADD)
{
llwarns << "Got an attachment with ATTACHMENT_ADD mask, removing ( attach pt:" << attachmentID << " )" << llendl;
attachmentID &= ~ATTACHMENT_ADD;
}
LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attachmentID, (LLViewerJointAttachment*)NULL);
if (!attachment)
{
llwarns << "Object attachment point invalid: " << attachmentID << llendl;
attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest)
}
return attachment;
@@ -7177,7 +7150,7 @@ BOOL LLVOAvatar::attachObject(LLViewerObject *viewer_object)
updateAttachmentVisibility(gAgent.getCameraMode());
// Then make sure the inventory is in sync with the avatar.
gInventory.addChangedMask(LLInventoryObserver::LABEL, viewer_object->getAttachmentItemID());
gInventory.addChangedMask( LLInventoryObserver::LABEL, item_id );
gInventory.notifyObservers();
}
}
@@ -7201,34 +7174,13 @@ BOOL LLVOAvatar::attachObject(LLViewerObject *viewer_object)
updateAttachmentVisibility(gAgent.getCameraMode());
// Then make sure the inventory is in sync with the avatar.
gInventory.addChangedMask(LLInventoryObserver::LABEL, viewer_object->getAttachmentItemID());
gInventory.addChangedMask( LLInventoryObserver::LABEL, attachment->getItemID() );
gInventory.notifyObservers();
}
return TRUE;
}
U32 LLVOAvatar::getNumAttachments() const
{
U32 num_attachments = 0;
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
{
LLViewerJointAttachment *attachment_pt = (*iter).second;
num_attachments += attachment_pt->getNumObjects();
}
return num_attachments;
}
//-----------------------------------------------------------------------------
// canAttachMoreObjects()
//-----------------------------------------------------------------------------
BOOL LLVOAvatar::canAttachMoreObjects() const
{
return (getNumAttachments() < MAX_AGENT_ATTACHMENTS);
}
//-----------------------------------------------------------------------------
// lazyAttach()
//-----------------------------------------------------------------------------
@@ -7264,20 +7216,16 @@ void LLVOAvatar::lazyAttach()
void LLVOAvatar::resetHUDAttachments()
{
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end(); iter++)
iter != mAttachmentPoints.end(); )
{
LLViewerJointAttachment* attachment = iter->second;
attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
if (attachment->getIsHUDAttachment())
{
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
LLViewerObject* obj = attachment->getObject();
if (obj && obj->mDrawable.notNull())
{
const LLViewerObject* attached_object = (*attachment_iter);
if (attached_object && attached_object->mDrawable.notNull())
{
gPipeline.markMoved(attached_object->mDrawable);
}
gPipeline.markMoved(obj->mDrawable);
}
}
}
@@ -7294,9 +7242,9 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
// only one object per attachment point for now
if (attachment->isObjectAttached(viewer_object))
if (attachment->getObject() == viewer_object)
{
LLUUID item_id = viewer_object->getAttachmentItemID();
LLUUID item_id = attachment->getItemID();
attachment->removeObject(viewer_object);
if (mIsSelf)
{
@@ -7561,15 +7509,14 @@ LLVOAvatar* LLVOAvatar::findAvatarFromAttachment( LLViewerObject* obj )
//-----------------------------------------------------------------------------
// isWearingAttachment()
//-----------------------------------------------------------------------------
BOOL LLVOAvatar::isWearingAttachment(const LLUUID& inv_item_id)
BOOL LLVOAvatar::isWearingAttachment( const LLUUID& inv_item_id )
{
const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id);
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end(); )
{
attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
if(attachment->getAttachedObject(base_inv_item_id))
if( attachment->getItemID() == inv_item_id )
{
return TRUE;
}
@@ -7593,17 +7540,16 @@ BOOL LLVOAvatar::isWearingUnsupportedAttachment( const LLUUID& inv_item_id )
//-----------------------------------------------------------------------------
// getWornAttachment()
//-----------------------------------------------------------------------------
LLViewerObject* LLVOAvatar::getWornAttachment(const LLUUID& inv_item_id)
LLViewerObject* LLVOAvatar::getWornAttachment( const LLUUID& inv_item_id )
{
const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id);
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end(); )
{
attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
if (LLViewerObject *attached_object = attachment->getAttachedObject(base_inv_item_id))
if( attachment->getItemID() == inv_item_id )
{
return attached_object;
return attachment->getObject();
}
}
return NULL;
@@ -7611,13 +7557,12 @@ LLViewerObject* LLVOAvatar::getWornAttachment(const LLUUID& inv_item_id)
const std::string LLVOAvatar::getAttachedPointName(const LLUUID& inv_item_id)
{
const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id);
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end(); )
{
attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
if (attachment->getAttachedObject(base_inv_item_id))
if( attachment->getItemID() == inv_item_id )
{
return attachment->getName();
}
@@ -9150,10 +9095,11 @@ void LLVOAvatar::clampAttachmentPositions()
BOOL LLVOAvatar::hasHUDAttachment() const
{
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end(); ++iter)
iter != mAttachmentPoints.end(); )
{
LLViewerJointAttachment* attachment = iter->second;
if (attachment->getIsHUDAttachment() && attachment->getNumObjects() > 0)
attachment_map_t::const_iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
if (attachment->getIsHUDAttachment() && attachment->getObject())
{
return TRUE;
}
@@ -9165,33 +9111,24 @@ LLBBox LLVOAvatar::getHUDBBox() const
{
LLBBox bbox;
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end(); ++iter)
iter != mAttachmentPoints.end(); )
{
LLViewerJointAttachment* attachment = iter->second;
if (attachment->getIsHUDAttachment())
attachment_map_t::const_iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
if (attachment->getIsHUDAttachment() && attachment->getObject())
{
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
LLViewerObject* hud_object = attachment->getObject();
// initialize bounding box to contain identity orientation and center point for attached object
bbox.addPointLocal(hud_object->getPosition());
// add rotated bounding box for attached object
bbox.addBBoxAgent(hud_object->getBoundingBoxAgent());
LLViewerObject::const_child_list_t& child_list = hud_object->getChildren();
for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
iter != child_list.end(); iter++)
{
const LLViewerObject* attached_object = (*attachment_iter);
if (attached_object == NULL)
{
llwarns << "HUD attached object is NULL!" << llendl;
continue;
}
// initialize bounding box to contain identity orientation and center point for attached object
bbox.addPointLocal(attached_object->getPosition());
// add rotated bounding box for attached object
bbox.addBBoxAgent(attached_object->getBoundingBoxAgent());
LLViewerObject::const_child_list_t& child_list = attached_object->getChildren();
for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
iter != child_list.end();
++iter)
{
const LLViewerObject* child_objectp = *iter;
bbox.addBBoxAgent(child_objectp->getBoundingBoxAgent());
}
LLViewerObject* child_objectp = *iter;
bbox.addBBoxAgent(child_objectp->getBoundingBoxAgent());
}
}
}
@@ -10625,25 +10562,20 @@ void LLVOAvatar::idleUpdateRenderCost()
++iter)
{
LLViewerJointAttachment* attachment = iter->second;
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
LLViewerObject* object = attachment->getObject();
if (object && !object->isHUDAttachment())
{
const LLViewerObject* attached_object = (*attachment_iter);
if (attached_object && !attached_object->isHUDAttachment())
LLDrawable* drawable = object->mDrawable;
if (drawable)
{
const LLDrawable* drawable = attached_object->mDrawable;
if (drawable)
shame += 10;
LLVOVolume* volume = drawable->getVOVolume();
if (volume)
{
shame += 10;
LLVOVolume* volume = drawable->getVOVolume();
if (volume)
{
shame += calc_shame(volume, textures);
}
}
}
}
shame += calc_shame(volume, textures);
}
}
}
}
if(sDoProperArc)