summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 3793d6b9b2..08798d81b7 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3240,6 +3240,19 @@ LLColor3 LLVOVolume::getLightColor() const
}
}
+LLColor3 LLVOVolume::getLightSRGBColor() const
+{
+ const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
+ if (param_block)
+ {
+ return LLColor3(param_block->getSRGBColor()) * param_block->getSRGBColor().mV[3];
+ }
+ else
+ {
+ return LLColor3(1, 1, 1);
+ }
+}
+
LLUUID LLVOVolume::getLightTextureID() const
{
if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
@@ -3276,18 +3289,16 @@ F32 LLVOVolume::getSpotLightPriority() const
void LLVOVolume::updateSpotLightPriority()
{
+ F32 r = getLightRadius();
LLVector3 pos = mDrawable->getPositionAgent();
+
LLVector3 at(0,0,-1);
at *= getRenderRotation();
-
- F32 r = getLightRadius()*0.5f;
-
pos += at * r;
at = LLViewerCamera::getInstance()->getAtAxis();
-
pos -= at * r;
-
+
mSpotLightPriority = gPipeline.calcPixelArea(pos, LLVector3(r,r,r), *LLViewerCamera::getInstance());
if (mLightTexture.notNull())