Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
commit
3fa868e9d6
|
|
@ -83,7 +83,9 @@ public:
|
|||
NUM_DATA_TYPE
|
||||
}eEntryDataType_t;
|
||||
|
||||
~LLViewerOctreeEntry();
|
||||
protected:
|
||||
virtual ~LLViewerOctreeEntry();
|
||||
|
||||
public:
|
||||
LLViewerOctreeEntry();
|
||||
|
||||
|
|
@ -187,7 +189,7 @@ class LLviewerOctreeGroup : public LLOctreeListener<LLViewerOctreeEntry>
|
|||
{
|
||||
friend class LLViewerOctreeCull;
|
||||
protected:
|
||||
~LLviewerOctreeGroup();
|
||||
virtual ~LLviewerOctreeGroup();
|
||||
|
||||
public:
|
||||
enum
|
||||
|
|
@ -303,13 +305,15 @@ public:
|
|||
STATE_MODE_ALL_CAMERAS, //used for occlusion state, set state for all cameras
|
||||
} eSetStateMode;
|
||||
|
||||
protected:
|
||||
virtual ~LLOcclusionCullingGroup();
|
||||
|
||||
public:
|
||||
LLOcclusionCullingGroup(OctreeNode* node, LLViewerOctreePartition* part);
|
||||
LLOcclusionCullingGroup(const LLOcclusionCullingGroup& rhs) : LLviewerOctreeGroup(rhs)
|
||||
{
|
||||
*this = rhs;
|
||||
}
|
||||
~LLOcclusionCullingGroup();
|
||||
}
|
||||
|
||||
void setOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE);
|
||||
void clearOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE);
|
||||
|
|
|
|||
|
|
@ -473,6 +473,31 @@ void LLVOCacheEntry::updateParentBoundingInfo(const LLVOCacheEntry* child)
|
|||
//-------------------------------------------------------------------
|
||||
//LLVOCachePartition
|
||||
//-------------------------------------------------------------------
|
||||
LLVOCacheGroup::~LLVOCacheGroup()
|
||||
{
|
||||
if(mOcclusionState[0] & ACTIVE_OCCLUSION)
|
||||
{
|
||||
((LLVOCachePartition*)mSpatialPartition)->removeOccluder(this);
|
||||
}
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLVOCacheGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child)
|
||||
{
|
||||
if (child->getListenerCount() == 0)
|
||||
{
|
||||
new LLVOCacheGroup(child, mSpatialPartition);
|
||||
}
|
||||
else
|
||||
{
|
||||
OCT_ERRS << "LLVOCacheGroup redundancy detected." << LL_ENDL;
|
||||
}
|
||||
|
||||
unbound();
|
||||
|
||||
((LLviewerOctreeGroup*)child->getListener(0))->unbound();
|
||||
}
|
||||
|
||||
LLVOCachePartition::LLVOCachePartition(LLViewerRegion* regionp)
|
||||
: LLTrace::MemTrackable<LLVOCachePartition>("LLVOCachePartition")
|
||||
{
|
||||
|
|
@ -487,7 +512,7 @@ LLVOCachePartition::LLVOCachePartition(LLViewerRegion* regionp)
|
|||
mCulledTime[i] = 0;
|
||||
mCullHistory[i] = -1;
|
||||
}
|
||||
new LLOcclusionCullingGroup(mOctree, this);
|
||||
new LLVOCacheGroup(mOctree, this);
|
||||
}
|
||||
|
||||
void LLVOCachePartition::addEntry(LLViewerOctreeEntry* entry)
|
||||
|
|
@ -755,11 +780,11 @@ S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion)
|
|||
|
||||
void LLVOCachePartition::addOccluders(LLviewerOctreeGroup* gp)
|
||||
{
|
||||
LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)gp;
|
||||
LLVOCacheGroup* group = (LLVOCacheGroup*)gp;
|
||||
|
||||
if(!group->isOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION))
|
||||
{
|
||||
group->setOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION);
|
||||
group->setOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION, LLOcclusionCullingGroup::STATE_MODE_ALL_CAMERAS);
|
||||
mOccludedGroups.insert(group);
|
||||
}
|
||||
}
|
||||
|
|
@ -773,9 +798,9 @@ void LLVOCachePartition::processOccluders(LLCamera* camera)
|
|||
|
||||
LLVector3 region_agent = mRegionp->getOriginAgent();
|
||||
LLVector4a shift(region_agent[0], region_agent[1], region_agent[2]);
|
||||
for(std::set<LLOcclusionCullingGroup*>::iterator iter = mOccludedGroups.begin(); iter != mOccludedGroups.end(); ++iter)
|
||||
for(std::set<LLVOCacheGroup*>::iterator iter = mOccludedGroups.begin(); iter != mOccludedGroups.end(); ++iter)
|
||||
{
|
||||
LLOcclusionCullingGroup* group = *iter;
|
||||
LLVOCacheGroup* group = *iter;
|
||||
group->doOcclusion(camera, &shift);
|
||||
}
|
||||
}
|
||||
|
|
@ -787,15 +812,23 @@ void LLVOCachePartition::resetOccluders()
|
|||
return;
|
||||
}
|
||||
|
||||
for(std::set<LLOcclusionCullingGroup*>::iterator iter = mOccludedGroups.begin(); iter != mOccludedGroups.end(); ++iter)
|
||||
for(std::set<LLVOCacheGroup*>::iterator iter = mOccludedGroups.begin(); iter != mOccludedGroups.end(); ++iter)
|
||||
{
|
||||
LLOcclusionCullingGroup* group = *iter;
|
||||
group->clearOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION);
|
||||
LLVOCacheGroup* group = *iter;
|
||||
group->clearOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION, LLOcclusionCullingGroup::STATE_MODE_ALL_CAMERAS);
|
||||
}
|
||||
mOccludedGroups.clear();
|
||||
sNeedsOcclusionCheck = FALSE;
|
||||
}
|
||||
|
||||
void LLVOCachePartition::removeOccluder(LLVOCacheGroup* group)
|
||||
{
|
||||
if(mOccludedGroups.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
mOccludedGroups.erase(group);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
//LLVOCache
|
||||
//-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -160,6 +160,18 @@ public:
|
|||
static U32 sMinFrameRange;
|
||||
};
|
||||
|
||||
class LLVOCacheGroup : public LLOcclusionCullingGroup
|
||||
{
|
||||
public:
|
||||
LLVOCacheGroup(OctreeNode* node, LLViewerOctreePartition* part) : LLOcclusionCullingGroup(node, part){}
|
||||
|
||||
//virtual
|
||||
void handleChildAddition(const OctreeNode* parent, OctreeNode* child);
|
||||
|
||||
protected:
|
||||
virtual ~LLVOCacheGroup();
|
||||
};
|
||||
|
||||
class LLVOCachePartition : public LLViewerOctreePartition, public LLTrace::MemTrackable<LLVOCachePartition>
|
||||
{
|
||||
public:
|
||||
|
|
@ -171,7 +183,8 @@ public:
|
|||
void addOccluders(LLviewerOctreeGroup* gp);
|
||||
void resetOccluders();
|
||||
void processOccluders(LLCamera* camera);
|
||||
|
||||
void removeOccluder(LLVOCacheGroup* group);
|
||||
|
||||
private:
|
||||
void selectBackObjects(LLCamera &camera); //select objects behind camera.
|
||||
|
||||
|
|
@ -181,7 +194,7 @@ public:
|
|||
private:
|
||||
U32 mCullHistory[LLViewerCamera::NUM_CAMERAS];
|
||||
U32 mCulledTime[LLViewerCamera::NUM_CAMERAS];
|
||||
std::set<LLOcclusionCullingGroup*> mOccludedGroups;
|
||||
std::set<LLVOCacheGroup*> mOccludedGroups;
|
||||
|
||||
S32 mBackSlectionEnabled; //enable to select back objects if > 0.
|
||||
U32 mIdleHash;
|
||||
|
|
|
|||
Loading…
Reference in New Issue