summaryrefslogtreecommitdiff
path: root/indra/newview/llhudeffectblob.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2011-03-14 17:23:14 -0700
committerLeyla Farazha <leyla@lindenlab.com>2011-03-14 17:23:14 -0700
commiteb59729b1eeb31a98afd1726bbb5439453639121 (patch)
tree3000ea47019ce10f25b3c51337001285f81ead4d /indra/newview/llhudeffectblob.cpp
parent4986896079c90c2fff1f72ccf78a4bb6ee9bbcb8 (diff)
parent5b7b82d4049c00e33decfea7753f06fbd5ef07c0 (diff)
Merge
Diffstat (limited to 'indra/newview/llhudeffectblob.cpp')
-rw-r--r--indra/newview/llhudeffectblob.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/indra/newview/llhudeffectblob.cpp b/indra/newview/llhudeffectblob.cpp
index 6ef8fab4a6..f976a320ee 100644
--- a/indra/newview/llhudeffectblob.cpp
+++ b/indra/newview/llhudeffectblob.cpp
@@ -28,8 +28,15 @@
#include "llhudeffectblob.h"
-LLHUDEffectBlob::LLHUDEffectBlob(const U8 type) : LLHUDEffect(type)
+#include "llagent.h"
+#include "llviewercamera.h"
+#include "llrendersphere.h"
+
+LLHUDEffectBlob::LLHUDEffectBlob(const U8 type)
+: LLHUDEffect(type),
+ mPixelSize(10)
{
+ mTimer.start();
}
LLHUDEffectBlob::~LLHUDEffectBlob()
@@ -38,6 +45,31 @@ LLHUDEffectBlob::~LLHUDEffectBlob()
void LLHUDEffectBlob::render()
{
+ F32 time = mTimer.getElapsedTimeF32();
+ if (mDuration < time)
+ {
+ markDead();
+ }
+
+ LLVector3 pos_agent = gAgent.getPosAgentFromGlobal(mPositionGlobal);
+
+ LLVector3 pixel_up, pixel_right;
+
+ LLViewerCamera::instance().getPixelVectors(pos_agent, pixel_up, pixel_right);
+
+ LLGLSPipelineAlpha gls_pipeline_alpha;
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+
+ LLColor4U color = mColor;
+ color.mV[VALPHA] = clamp_rescale(time, 0.f, mDuration, 255.f, 0.f);
+ glColor4ubv(color.mV);
+
+ glPushMatrix();
+ glTranslatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]);
+ F32 scale = pixel_up.magVec() * (F32)mPixelSize;
+ glScalef(scale, scale, scale);
+ gSphere.render(0);
+ glPopMatrix();
}
void LLHUDEffectBlob::renderForTimer()