diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2011-03-14 17:23:14 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2011-03-14 17:23:14 -0700 |
commit | eb59729b1eeb31a98afd1726bbb5439453639121 (patch) | |
tree | 3000ea47019ce10f25b3c51337001285f81ead4d /indra/newview/llhudeffectblob.cpp | |
parent | 4986896079c90c2fff1f72ccf78a4bb6ee9bbcb8 (diff) | |
parent | 5b7b82d4049c00e33decfea7753f06fbd5ef07c0 (diff) |
Merge
Diffstat (limited to 'indra/newview/llhudeffectblob.cpp')
-rw-r--r-- | indra/newview/llhudeffectblob.cpp | 34 |
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() |