summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawable.cpp
diff options
context:
space:
mode:
authorDavid Parks <davep@lindenlab.com>2009-09-22 11:11:45 +0000
committerDavid Parks <davep@lindenlab.com>2009-09-22 11:11:45 +0000
commit536e38ad51b89808f26d8e3cd107fe093862d22a (patch)
tree230159ae9e319f5c419f1a643177b2bbb17d52c5 /indra/newview/lldrawable.cpp
parent760adead96e62cab8f9cdacc6469773a87dfbc1a (diff)
Merging render-pipeline-6-qa-2 into viewer-2
Self reviewed.
Diffstat (limited to 'indra/newview/lldrawable.cpp')
-rw-r--r--indra/newview/lldrawable.cpp58
1 files changed, 40 insertions, 18 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 7cc78aff92..4cf12a1533 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -678,6 +678,11 @@ BOOL LLDrawable::updateMoveDamped()
void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
{
+ if (LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD)
+ {
+ llerrs << "WTF?" << llendl;
+ }
+
//switch LOD with the spatial group to avoid artifacts
//LLSpatialGroup* sg = getSpatialGroup();
@@ -695,19 +700,22 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
pos += volume->getRegion()->getOriginAgent();
}
- for (S32 i = 0; i < getNumFaces(); i++)
+ if (isState(LLDrawable::HAS_ALPHA))
{
- LLFace* facep = getFace(i);
- if (force_update || facep->getPoolType() == LLDrawPool::POOL_ALPHA)
+ for (S32 i = 0; i < getNumFaces(); i++)
{
- LLVector3 box = (facep->mExtents[1] - facep->mExtents[0]) * 0.25f;
- LLVector3 v = (facep->mCenterLocal-camera.getOrigin());
- LLVector3 at = camera.getAtAxis();
- for (U32 j = 0; j < 3; j++)
+ LLFace* facep = getFace(i);
+ if (force_update || facep->getPoolType() == LLDrawPool::POOL_ALPHA)
{
- v.mV[j] -= box.mV[j] * at.mV[j];
+ LLVector3 box = (facep->mExtents[1] - facep->mExtents[0]) * 0.25f;
+ LLVector3 v = (facep->mCenterLocal-camera.getOrigin());
+ const LLVector3& at = camera.getAtAxis();
+ for (U32 j = 0; j < 3; j++)
+ {
+ v.mV[j] -= box.mV[j] * at.mV[j];
+ }
+ facep->mDistance = v * camera.getAtAxis();
}
- facep->mDistance = v * camera.getAtAxis();
}
}
}
@@ -1002,8 +1010,8 @@ BOOL LLDrawable::isVisible() const
// Spatial Partition Bridging Drawable
//=======================================
-LLSpatialBridge::LLSpatialBridge(LLDrawable* root, U32 data_mask)
-: LLSpatialPartition(data_mask, FALSE)
+LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 data_mask)
+: LLSpatialPartition(data_mask, render_by_group, FALSE)
{
mDrawable = root;
root->setSpatialBridge(this);
@@ -1241,7 +1249,9 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>*
(camera_in.AABBInFrustumNoFarClip(center, size) &&
AABBSphereIntersect(mExtents[0], mExtents[1], camera_in.getOrigin(), camera_in.mFrustumCornerDist)))
{
- if (!LLPipeline::sImpostorRender && LLPipeline::calcPixelArea(center, size, camera_in) < FORCE_INVISIBLE_AREA)
+ if (!LLPipeline::sImpostorRender &&
+ !LLPipeline::sShadowRender &&
+ LLPipeline::calcPixelArea(center, size, camera_in) < FORCE_INVISIBLE_AREA)
{
return;
}
@@ -1280,12 +1290,25 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
return;
}
- LLCamera camera = transformCamera(camera_in);
-
- mDrawable->updateDistance(camera, force_update);
-
if (mDrawable->getVObj())
{
+ if (mDrawable->getVObj()->isAttachment())
+ {
+ LLDrawable* parent = mDrawable->getParent();
+ if (parent && parent->getVObj())
+ {
+ LLVOAvatar* av = parent->getVObj()->asAvatar();
+ if (av && av->isImpostor())
+ {
+ return;
+ }
+ }
+ }
+
+ LLCamera camera = transformCamera(camera_in);
+
+ mDrawable->updateDistance(camera, force_update);
+
LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
iter != child_list.end(); iter++)
@@ -1427,9 +1450,8 @@ void LLDrawable::updateFaceSize(S32 idx)
}
LLBridgePartition::LLBridgePartition()
-: LLSpatialPartition(0, TRUE)
+: LLSpatialPartition(0, FALSE, 0)
{
- mRenderByGroup = FALSE;
mDrawableType = LLPipeline::RENDER_TYPE_AVATAR;
mPartitionType = LLViewerRegion::PARTITION_BRIDGE;
mLODPeriod = 16;