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