Toss attachments into their own bridge that sets their type to TYPE_AVATAR, and use generic bridge for plain old 'active' volumes. Resolves issue where non-attached ACTIVE flagged linksets would be included in the avatar render type, and thus would vanish when such type was disabled.

This commit is contained in:
Shyotl
2015-05-22 16:14:57 -05:00
parent af020ad558
commit d4a56c6d94
8 changed files with 41 additions and 9 deletions

View File

@@ -1056,6 +1056,10 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
{
setSpatialBridge(new LLHUDBridge(this));
}
else if (mVObjp->isAttachment())
{
setSpatialBridge(new LLAttachmentBridge(this));
}
else
{
setSpatialBridge(new LLVolumeBridge(this));
@@ -1663,12 +1667,18 @@ void LLDrawable::updateFaceSize(S32 idx)
LLBridgePartition::LLBridgePartition()
: LLSpatialPartition(0, FALSE, 0)
{
mDrawableType = LLPipeline::RENDER_TYPE_AVATAR;
mDrawableType = LLPipeline::RENDER_TYPE_VOLUME;
mPartitionType = LLViewerRegion::PARTITION_BRIDGE;
mLODPeriod = 16;
mSlopRatio = 0.25f;
}
LLAttachmentPartition::LLAttachmentPartition()
: LLBridgePartition()
{
mDrawableType = LLPipeline::RENDER_TYPE_AVATAR;
}
LLHUDBridge::LLHUDBridge(LLDrawable* drawablep)
: LLVolumeBridge(drawablep)
{

View File

@@ -792,6 +792,7 @@ void LLSpatialGroup::shift(const LLVector4a &offset)
if (!mSpatialPartition->mRenderByGroup &&
mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_TREE &&
mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_TERRAIN &&
mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_ATTACHMENT &&
mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_BRIDGE)
{
setState(GEOM_DIRTY);

View File

@@ -737,6 +737,12 @@ public:
virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { LLVolumeGeometryManager::addGeometryCount(group, vertex_count, index_count); }
};
class LLAttachmentBridge : public LLVolumeBridge
{
public:
LLAttachmentBridge(LLDrawable* drawable);
};
class LLHUDBridge : public LLVolumeBridge
{
public:
@@ -754,11 +760,18 @@ public:
virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { }
};
//spatial partition that holds nothing but spatial bridges
class LLAttachmentPartition : public LLBridgePartition
{
public:
LLAttachmentPartition();
};
class LLHUDPartition : public LLBridgePartition
{
public:
LLHUDPartition();
virtual void shift(const LLVector4a &offset);
virtual void shift(const LLVector4a &offset) { } //HUD objects don't shift with region crossing. That would be silly.
};
extern const F32 SG_BOX_SIDE;

View File

@@ -380,6 +380,7 @@ void LLViewerRegion::initPartitions()
mImpl->mObjectPartition.push_back(new LLGrassPartition()); //PARTITION_GRASS
mImpl->mObjectPartition.push_back(new LLVolumePartition()); //PARTITION_VOLUME
mImpl->mObjectPartition.push_back(new LLBridgePartition()); //PARTITION_BRIDGE
mImpl->mObjectPartition.push_back(new LLAttachmentPartition()); //PARTITION_ATTACHMENT
mImpl->mObjectPartition.push_back(new LLHUDParticlePartition());//PARTITION_HUD_PARTICLE
mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE
}

View File

@@ -99,6 +99,7 @@ public:
PARTITION_GRASS,
PARTITION_VOLUME,
PARTITION_BRIDGE,
PARTITION_ATTACHMENT,
PARTITION_HUD_PARTICLE,
PARTITION_NONE,
NUM_PARTITIONS

View File

@@ -9017,7 +9017,7 @@ void LLVOAvatar::updateSoftwareSkinnedVertices(const LLMeshSkinInfo* skin, const
U32 LLVOAvatar::getPartitionType() const
{
// Avatars merely exist as drawables in the bridge partition
return LLViewerRegion::PARTITION_BRIDGE;
return LLViewerRegion::PARTITION_ATTACHMENT;
}
//static

View File

@@ -4000,6 +4000,10 @@ U32 LLVOVolume::getPartitionType() const
{
return LLViewerRegion::PARTITION_HUD;
}
else if (isAttachment())
{
return LLViewerRegion::PARTITION_ATTACHMENT;
}
return LLViewerRegion::PARTITION_VOLUME;
}
@@ -4028,6 +4032,12 @@ LLVolumeBridge::LLVolumeBridge(LLDrawable* drawablep)
mSlopRatio = 0.25f;
}
LLAttachmentBridge::LLAttachmentBridge(LLDrawable* drawablep)
: LLVolumeBridge(drawablep)
{
mPartitionType = LLViewerRegion::PARTITION_ATTACHMENT;
}
bool can_batch_texture(const LLFace* facep)
{
static const LLCachedControl<bool> alt_batching("SHAltBatching",true);
@@ -6390,9 +6400,4 @@ LLHUDPartition::LLHUDPartition()
mLODPeriod = 1;
}
void LLHUDPartition::shift(const LLVector4a &offset)
{
//HUD objects don't shift with region crossing. That would be silly.
}

View File

@@ -6492,6 +6492,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start,
for (U32 j = 0; j < LLViewerRegion::NUM_PARTITIONS; j++)
{
if ((j == LLViewerRegion::PARTITION_VOLUME) ||
(j == LLViewerRegion::PARTITION_ATTACHMENT) ||
(j == LLViewerRegion::PARTITION_BRIDGE) ||
(j == LLViewerRegion::PARTITION_TERRAIN) ||
(j == LLViewerRegion::PARTITION_TREE) ||
@@ -6554,7 +6555,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start,
{
LLViewerRegion* region = *iter;
LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_BRIDGE);
LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_ATTACHMENT);
if (part && hasRenderType(part->mDrawableType))
{
LLDrawable* hit = part->lineSegmentIntersect(start, local_end, pick_transparent, face_hit, &position, tex_coord, normal, tangent);