aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lldrawable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lldrawable.cpp')
-rw-r--r--linden/indra/newview/lldrawable.cpp76
1 files changed, 48 insertions, 28 deletions
diff --git a/linden/indra/newview/lldrawable.cpp b/linden/indra/newview/lldrawable.cpp
index 5a383bc..2b43374 100644
--- a/linden/indra/newview/lldrawable.cpp
+++ b/linden/indra/newview/lldrawable.cpp
@@ -102,7 +102,7 @@ void LLDrawable::init()
102 mVObjp = NULL; 102 mVObjp = NULL;
103 // mFaces 103 // mFaces
104 mSpatialGroupp = NULL; 104 mSpatialGroupp = NULL;
105 mVisible = sCurVisible - 2;//invisible for the current frame and the last frame. 105 mVisible = 0;
106 mRadius = 0.f; 106 mRadius = 0.f;
107 107
108 mGeneration = -1; 108 mGeneration = -1;
@@ -125,7 +125,7 @@ void LLDrawable::destroy()
125 125
126 if (LLSpatialGroup::sNoDelete) 126 if (LLSpatialGroup::sNoDelete)
127 { 127 {
128 llerrs << "Illegal deletion of LLDrawable!" << llendl; 128 llwarns << "Illegal deletion of LLDrawable!" << llendl;
129 } 129 }
130 130
131 std::for_each(mFaces.begin(), mFaces.end(), DeletePointer()); 131 std::for_each(mFaces.begin(), mFaces.end(), DeletePointer());
@@ -234,7 +234,7 @@ LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerImage *texturep)
234 LLMemType mt(LLMemType::MTYPE_DRAWABLE); 234 LLMemType mt(LLMemType::MTYPE_DRAWABLE);
235 235
236 LLFace *face = new LLFace(this, mVObjp); 236 LLFace *face = new LLFace(this, mVObjp);
237 if (!face) llerrs << "Allocating new Face: " << mFaces.size() << llendl; 237 if (!face) llwarns << "Allocating new Face: " << mFaces.size() << llendl;
238 238
239 if (face) 239 if (face)
240 { 240 {
@@ -346,7 +346,7 @@ void LLDrawable::deleteFaces(S32 offset, S32 count)
346 346
347void LLDrawable::update() 347void LLDrawable::update()
348{ 348{
349 llerrs << "Shouldn't be called!" << llendl; 349 llwarns << "Shouldn't be called!" << llendl;
350} 350}
351 351
352 352
@@ -369,7 +369,7 @@ void LLDrawable::makeActive()
369 pcode == LLViewerObject::LL_VO_GROUND || 369 pcode == LLViewerObject::LL_VO_GROUND ||
370 pcode == LLViewerObject::LL_VO_SKY) 370 pcode == LLViewerObject::LL_VO_SKY)
371 { 371 {
372 llerrs << "Static viewer object has active drawable!" << llendl; 372 llwarns << "Static viewer object has active drawable!" << llendl;
373 } 373 }
374 } 374 }
375#endif 375#endif
@@ -693,19 +693,22 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
693 pos += volume->getRegion()->getOriginAgent(); 693 pos += volume->getRegion()->getOriginAgent();
694 } 694 }
695 695
696 for (S32 i = 0; i < getNumFaces(); i++) 696 if (isState(LLDrawable::HAS_ALPHA))
697 { 697 {
698 LLFace* facep = getFace(i); 698 for (S32 i = 0; i < getNumFaces(); i++)
699 if (force_update || facep->getPoolType() == LLDrawPool::POOL_ALPHA)
700 { 699 {
701 LLVector3 box = (facep->mExtents[1] - facep->mExtents[0]) * 0.25f; 700 LLFace* facep = getFace(i);
702 LLVector3 v = (facep->mCenterLocal-camera.getOrigin()); 701 if (facep->getPoolType() == LLDrawPool::POOL_ALPHA)
703 LLVector3 at = camera.getAtAxis();
704 for (U32 j = 0; j < 3; j++)
705 { 702 {
706 v.mV[j] -= box.mV[j] * at.mV[j]; 703 LLVector3 box = (facep->mExtents[1] - facep->mExtents[0]) * 0.25f;
704 LLVector3 v = (facep->mCenterLocal-camera.getOrigin());
705 const LLVector3& at = camera.getAtAxis();
706 for (U32 j = 0; j < 3; j++)
707 {
708 v.mV[j] -= box.mV[j] * at.mV[j];
709 }
710 facep->mDistance = v * camera.getAtAxis();
707 } 711 }
708 facep->mDistance = v * camera.getAtAxis();
709 } 712 }
710 } 713 }
711 } 714 }
@@ -737,7 +740,11 @@ void LLDrawable::updateTexture()
737 740
738 if (getVOVolume()) 741 if (getVOVolume())
739 { 742 {
740 if (isActive()) 743 if (!isActive())
744 {
745 //gPipeline.markMoved(this);
746 }
747 else
741 { 748 {
742 if (isRoot()) 749 if (isRoot())
743 { 750 {
@@ -1004,8 +1011,8 @@ BOOL LLDrawable::isVisible() const
1004// Spatial Partition Bridging Drawable 1011// Spatial Partition Bridging Drawable
1005//======================================= 1012//=======================================
1006 1013
1007LLSpatialBridge::LLSpatialBridge(LLDrawable* root, U32 data_mask) 1014LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 data_mask) // KL Sd version
1008: LLSpatialPartition(data_mask, FALSE) 1015: LLSpatialPartition(data_mask, render_by_group, FALSE)
1009{ 1016{
1010 mDrawable = root; 1017 mDrawable = root;
1011 root->setSpatialBridge(this); 1018 root->setSpatialBridge(this);
@@ -1135,26 +1142,26 @@ void LLDrawable::setVisible(LLCamera& camera, std::vector<LLDrawable*>* results,
1135 { 1142 {
1136 if (isActive() && !mParent->isActive()) 1143 if (isActive() && !mParent->isActive())
1137 { 1144 {
1138 llerrs << "Active drawable has static parent!" << llendl; 1145 llwarns << "Active drawable has static parent!" << llendl;
1139 } 1146 }
1140 1147
1141 if (isStatic() && !mParent->isStatic()) 1148 if (isStatic() && !mParent->isStatic())
1142 { 1149 {
1143 llerrs << "Static drawable has active parent!" << llendl; 1150 llwarns << "Static drawable has active parent!" << llendl;
1144 } 1151 }
1145 1152
1146 if (mSpatialBridge) 1153 if (mSpatialBridge)
1147 { 1154 {
1148 llerrs << "Child drawable has spatial bridge!" << llendl; 1155 llwarns << "Child drawable has spatial bridge!" << llendl;
1149 } 1156 }
1150 } 1157 }
1151 else if (isActive() && !mSpatialBridge) 1158 else if (isActive() && !mSpatialBridge)
1152 { 1159 {
1153 llerrs << "Active root drawable has no spatial bridge!" << llendl; 1160 llwarns << "Active root drawable has no spatial bridge!" << llendl;
1154 } 1161 }
1155 else if (isStatic() && mSpatialBridge.notNull()) 1162 else if (isStatic() && mSpatialBridge.notNull())
1156 { 1163 {
1157 llerrs << "Static drawable has spatial bridge!" << llendl; 1164 llwarns << "Static drawable has spatial bridge!" << llendl;
1158 } 1165 }
1159 } 1166 }
1160#endif 1167#endif
@@ -1278,12 +1285,25 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
1278 return; 1285 return;
1279 } 1286 }
1280 1287
1281 LLCamera camera = transformCamera(camera_in); 1288 if (mDrawable->getVObj())
1289 {
1290 if (mDrawable->getVObj()->isAttachment())
1291 {
1292 LLDrawable* parent = mDrawable->getParent();
1293 if (parent && parent->getVObj())
1294 {
1295 LLVOAvatar* av = parent->getVObj()->asAvatar();
1296 if (av && av->isImpostor())
1297 {
1298 return;
1299 }
1300 }
1301 }
1302
1303 LLCamera camera = transformCamera(camera_in);
1282 1304
1283 mDrawable->updateDistance(camera, force_update); 1305 mDrawable->updateDistance(camera, force_update);
1284 1306
1285 if (mDrawable->getVObj())
1286 {
1287 LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren(); 1307 LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
1288 for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); 1308 for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
1289 iter != child_list.end(); iter++) 1309 iter != child_list.end(); iter++)
@@ -1305,7 +1325,7 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
1305 1325
1306void LLSpatialBridge::makeActive() 1326void LLSpatialBridge::makeActive()
1307{ //it is an error to make a spatial bridge active (it's already active) 1327{ //it is an error to make a spatial bridge active (it's already active)
1308 llerrs << "makeActive called on spatial bridge" << llendl; 1328 llwarns << "makeActive called on spatial bridge" << llendl;
1309} 1329}
1310 1330
1311void LLSpatialBridge::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL immediate) 1331void LLSpatialBridge::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL immediate)
@@ -1421,9 +1441,9 @@ void LLDrawable::updateFaceSize(S32 idx)
1421} 1441}
1422 1442
1423LLBridgePartition::LLBridgePartition() 1443LLBridgePartition::LLBridgePartition()
1424: LLSpatialPartition(0, TRUE) 1444: LLSpatialPartition(0, FALSE, 0)
1425{ 1445{
1426 mRenderByGroup = FALSE; 1446 //mRenderByGroup = FALSE; // KL
1427 mDrawableType = LLPipeline::RENDER_TYPE_AVATAR; 1447 mDrawableType = LLPipeline::RENDER_TYPE_AVATAR;
1428 mPartitionType = LLViewerRegion::PARTITION_BRIDGE; 1448 mPartitionType = LLViewerRegion::PARTITION_BRIDGE;
1429 mLODPeriod = 16; 1449 mLODPeriod = 16;