summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp52
1 files changed, 34 insertions, 18 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index ff5d7e9c17..03e524268d 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -2904,21 +2904,28 @@ F32 LLViewerObject::getLinksetCost()
return mLinksetCost;
}
-void LLViewerObject::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax)
+
+
+void LLViewerObject::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
{
- LLVector3 center = getRenderPosition();
- LLVector3 size = getScale();
- newMin.setVec(center-size);
- newMax.setVec(center+size);
- mDrawable->setPositionGroup((newMin + newMax) * 0.5f);
+ LLVector4a center;
+ center.load3(getRenderPosition().mV);
+ LLVector4a size;
+ size.load3(getScale().mV);
+ newMin.setSub(center, size);
+ newMax.setAdd(center, size);
+
+ mDrawable->setPositionGroup(center);
}
F32 LLViewerObject::getBinRadius()
{
if (mDrawable.notNull())
{
- const LLVector3* ext = mDrawable->getSpatialExtents();
- return (ext[1]-ext[0]).magVec();
+ const LLVector4a* ext = mDrawable->getSpatialExtents();
+ LLVector4a diff;
+ diff.setSub(ext[1], ext[0]);
+ return diff.length3();
}
return getScale().magVec();
@@ -3510,12 +3517,21 @@ BOOL LLViewerObject::lineSegmentBoundingBox(const LLVector3& start, const LLVect
return FALSE;
}
- const LLVector3* ext = mDrawable->getSpatialExtents();
+ const LLVector4a* ext = mDrawable->getSpatialExtents();
+
+ //VECTORIZE THIS
+ LLVector4a center;
+ center.setAdd(ext[1], ext[0]);
+ center.mul(0.5f);
+ LLVector4a size;
+ size.setSub(ext[1], ext[0]);
+ size.mul(0.5f);
- LLVector3 center = (ext[1]+ext[0])*0.5f;
- LLVector3 size = (ext[1]-ext[0])*0.5f;
+ LLVector4a starta, enda;
+ starta.load3(start.mV);
+ enda.load3(end.mV);
- return LLLineSegmentBoxIntersect(start, end, center, size);
+ return LLLineSegmentBoxIntersect(starta, enda, center, size);
}
U8 LLViewerObject::getMediaType() const
@@ -4770,7 +4786,7 @@ BOOL LLViewerObject::permYouOwner() const
return TRUE;
#else
# ifdef TOGGLE_HACKED_GODLIKE_VIEWER
- if (!LLViewerLogin::getInstance()->isInProductionGrid()
+ if (!LLGridManager::getInstance()->isInProductionGrid()
&& (gAgent.getGodLevel() >= GOD_MAINTENANCE))
{
return TRUE;
@@ -4807,7 +4823,7 @@ BOOL LLViewerObject::permOwnerModify() const
return TRUE;
#else
# ifdef TOGGLE_HACKED_GODLIKE_VIEWER
- if (!LLViewerLogin::getInstance()->isInProductionGrid()
+ if (!LLGridManager::getInstance()->isInProductionGrid()
&& (gAgent.getGodLevel() >= GOD_MAINTENANCE))
{
return TRUE;
@@ -4831,7 +4847,7 @@ BOOL LLViewerObject::permModify() const
return TRUE;
#else
# ifdef TOGGLE_HACKED_GODLIKE_VIEWER
- if (!LLViewerLogin::getInstance()->isInProductionGrid()
+ if (!LLGridManager::getInstance()->isInProductionGrid()
&& (gAgent.getGodLevel() >= GOD_MAINTENANCE))
{
return TRUE;
@@ -4855,7 +4871,7 @@ BOOL LLViewerObject::permCopy() const
return TRUE;
#else
# ifdef TOGGLE_HACKED_GODLIKE_VIEWER
- if (!LLViewerLogin::getInstance()->isInProductionGrid()
+ if (!LLGridManager::getInstance()->isInProductionGrid()
&& (gAgent.getGodLevel() >= GOD_MAINTENANCE))
{
return TRUE;
@@ -4879,7 +4895,7 @@ BOOL LLViewerObject::permMove() const
return TRUE;
#else
# ifdef TOGGLE_HACKED_GODLIKE_VIEWER
- if (!LLViewerLogin::getInstance()->isInProductionGrid()
+ if (!LLGridManager::getInstance()->isInProductionGrid()
&& (gAgent.getGodLevel() >= GOD_MAINTENANCE))
{
return TRUE;
@@ -4903,7 +4919,7 @@ BOOL LLViewerObject::permTransfer() const
return TRUE;
#else
# ifdef TOGGLE_HACKED_GODLIKE_VIEWER
- if (!LLViewerLogin::getInstance()->isInProductionGrid()
+ if (!LLGridManager::getInstance()->isInProductionGrid()
&& (gAgent.getGodLevel() >= GOD_MAINTENANCE))
{
return TRUE;