pull from viewer-development
commit
b82f2c4e4d
|
|
@ -3008,6 +3008,8 @@ void LLViewerObject::setScale(const LLVector3 &scale, BOOL damped)
|
|||
{
|
||||
if (!mOnMap)
|
||||
{
|
||||
llassert_always(LLWorld::getInstance()->getRegionFromHandle(getRegion()->getHandle()));
|
||||
|
||||
gObjectList.addToMap(this);
|
||||
mOnMap = TRUE;
|
||||
}
|
||||
|
|
@ -3535,8 +3537,8 @@ void LLViewerObject::setPositionParent(const LLVector3 &pos_parent, BOOL damped)
|
|||
// Set position relative to parent, if no parent, relative to region
|
||||
if (!isRoot())
|
||||
{
|
||||
LLViewerObject::setPosition(pos_parent);
|
||||
updateDrawable(damped);
|
||||
LLViewerObject::setPosition(pos_parent, damped);
|
||||
//updateDrawable(damped);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -3577,6 +3579,7 @@ void LLViewerObject::setPositionEdit(const LLVector3 &pos_edit, BOOL damped)
|
|||
LLVector3 position_offset = getPosition() * getParent()->getRotation();
|
||||
|
||||
((LLViewerObject *)getParent())->setPositionEdit(pos_edit - position_offset);
|
||||
updateDrawable(damped);
|
||||
}
|
||||
else if (isJointChild())
|
||||
{
|
||||
|
|
@ -3585,15 +3588,14 @@ void LLViewerObject::setPositionEdit(const LLVector3 &pos_edit, BOOL damped)
|
|||
LLQuaternion inv_parent_rot = parent->getRotation();
|
||||
inv_parent_rot.transQuat();
|
||||
LLVector3 pos_parent = (pos_edit - parent->getPositionRegion()) * inv_parent_rot;
|
||||
LLViewerObject::setPosition(pos_parent);
|
||||
LLViewerObject::setPosition(pos_parent, damped);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLViewerObject::setPosition(pos_edit);
|
||||
LLViewerObject::setPosition(pos_edit, damped);
|
||||
mPositionRegion = pos_edit;
|
||||
mPositionAgent = mRegionp->getPosAgentFromRegion(mPositionRegion);
|
||||
}
|
||||
updateDrawable(damped);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1124,6 +1124,22 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
|
|||
LLWorld::getInstance()->shiftRegions(offset);
|
||||
}
|
||||
|
||||
//debug code
|
||||
bool LLViewerObjectList::hasMapObjectInRegion(LLViewerRegion* regionp)
|
||||
{
|
||||
for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter)
|
||||
{
|
||||
LLViewerObject* objectp = *iter;
|
||||
|
||||
if(objectp->isDead() || objectp->getRegion() == regionp)
|
||||
{
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
|
||||
return false ;
|
||||
}
|
||||
|
||||
void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
|
||||
{
|
||||
LLColor4 above_water_color = LLUIColorTable::instance().getColor( "NetMapOtherOwnAboveWater" );
|
||||
|
|
@ -1142,6 +1158,9 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
|
|||
for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter)
|
||||
{
|
||||
LLViewerObject* objectp = *iter;
|
||||
|
||||
llassert_always(!objectp->isDead());
|
||||
|
||||
if (!objectp->getRegion() || objectp->isOrphaned() || objectp->isAttachment())
|
||||
{
|
||||
continue;
|
||||
|
|
@ -1429,7 +1448,7 @@ LLViewerObject *LLViewerObjectList::replaceObject(const LLUUID &id, const LLPCod
|
|||
LLViewerObject *old_instance = findObject(id);
|
||||
if (old_instance)
|
||||
{
|
||||
cleanupReferences(old_instance);
|
||||
//cleanupReferences(old_instance);
|
||||
old_instance->markDead();
|
||||
|
||||
return createObject(pcode, regionp, id, old_instance->getLocalID(), LLHost());
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ public:
|
|||
|
||||
void shiftObjects(const LLVector3 &offset);
|
||||
|
||||
bool hasMapObjectInRegion(LLViewerRegion* regionp) ;
|
||||
void renderObjectsForMap(LLNetMap &netmap);
|
||||
void renderObjectBounds(const LLVector3 ¢er);
|
||||
|
||||
|
|
|
|||
|
|
@ -281,6 +281,8 @@ void LLWorld::removeRegion(const LLHost &host)
|
|||
delete regionp;
|
||||
|
||||
updateWaterObjects();
|
||||
|
||||
llassert_always(!gObjectList.hasMapObjectInRegion(regionp)) ;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue