summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawable.cpp')
-rw-r--r--indra/newview/lldrawable.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index d370c72a04..bdc12ec0e3 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -708,7 +708,14 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
LLVOVolume* volume = getVOVolume();
if (volume)
{
- pos.set(getPositionGroup().getF32ptr());
+ if (getSpatialGroup())
+ {
+ pos.set(getPositionGroup().getF32ptr());
+ }
+ else
+ {
+ pos = getPositionAgent();
+ }
if (isState(LLDrawable::HAS_ALPHA))
{
@@ -820,8 +827,7 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
if (!volume && facep->hasGeometry())
{
- facep->mVertexBuffer = NULL;
- facep->mLastVertexBuffer = NULL;
+ facep->clearVertexBuffer();
}
}
@@ -935,6 +941,18 @@ void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
{
mSpatialGroupp->setState(LLSpatialGroup::GEOM_DIRTY);
}*/
+
+ if (mSpatialGroupp != groupp && getVOVolume())
+ { //NULL out vertex buffer references for volumes on spatial group change to maintain
+ //requirement that every face vertex buffer is either NULL or points to a vertex buffer
+ //contained by its drawable's spatial group
+ for (S32 i = 0; i < getNumFaces(); ++i)
+ {
+ LLFace* facep = getFace(i);
+ facep->clearVertexBuffer();
+ }
+ }
+
mSpatialGroupp = groupp;
}