summaryrefslogtreecommitdiff
path: root/indra/newview/llvopartgroup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvopartgroup.cpp')
-rw-r--r--indra/newview/llvopartgroup.cpp45
1 files changed, 38 insertions, 7 deletions
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index 3724a94edd..657e1680f1 100644
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -133,15 +133,16 @@ F32 LLVOPartGroup::getPartSize(S32 idx)
return 0.f;
}
+LLVector3 LLVOPartGroup::getCameraPosition() const
+{
+ return gAgent.getCameraPositionAgent();
+}
+
BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable)
{
LLFastTimer ftm(LLFastTimer::FTM_UPDATE_PARTICLES);
dirtySpatialGroup();
-
- LLVector3 at;
- LLVector3 position_agent;
- LLVector3 camera_agent = LLViewerCamera::getInstance()->getOrigin();
S32 num_parts = mViewerPartGroupp->getCount();
LLFace *facep;
@@ -187,7 +188,7 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable)
const LLViewerPart *part = mViewerPartGroupp->mParticles[i];
LLVector3 part_pos_agent(part->mPosAgent);
- at = part_pos_agent - camera_agent;
+ LLVector3 at(part_pos_agent - LLViewerCamera::getInstance()->getOrigin());
F32 camera_dist_squared = at.lengthSquared();
F32 inv_camera_dist_squared;
@@ -278,9 +279,10 @@ void LLVOPartGroup::getGeometry(S32 idx,
LLVector3 part_pos_agent(part.mPosAgent);
- LLVector3 camera_agent = gAgent.getCameraPositionAgent();
+ LLVector3 camera_agent = getCameraPosition();
LLVector3 at = part_pos_agent - camera_agent;
- LLVector3 up, right;
+ LLVector3 up;
+ LLVector3 right;
right = at % LLVector3(0.f, 0.f, 1.f);
right.normalize();
@@ -308,6 +310,7 @@ void LLVOPartGroup::getGeometry(S32 idx,
right *= 0.5f*part.mScale.mV[0];
up *= 0.5f*part.mScale.mV[1];
+
const LLVector3& normal = -LLViewerCamera::getInstance()->getXAxis();
*verticesp++ = part_pos_agent + up - right;
@@ -355,6 +358,13 @@ LLParticlePartition::LLParticlePartition()
mLODPeriod = 1;
}
+LLHUDParticlePartition::LLHUDParticlePartition() :
+ LLParticlePartition()
+{
+ mDrawableType = LLPipeline::RENDER_TYPE_HUD;
+ mPartitionType = LLViewerRegion::PARTITION_HUD_PARTICLE;
+}
+
void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count, U32& index_count)
{
group->mBufferUsage = mBufferUsage;
@@ -480,3 +490,24 @@ F32 LLParticlePartition::calcPixelArea(LLSpatialGroup* group, LLCamera& camera)
return 1024.f;
}
+U32 LLVOHUDPartGroup::getPartitionType() const
+{
+ // Commenting out and returning PARTITION_NONE because DEV-16909
+ // (SVC-2396: Particles not handled properly as hud) didn't work completely
+ // so this disables HUD particles until they can be fixed properly. -MG
+ //return LLViewerRegion::PARTITION_HUD_PARTICLE;
+ return LLViewerRegion::PARTITION_NONE;
+}
+
+LLDrawable* LLVOHUDPartGroup::createDrawable(LLPipeline *pipeline)
+{
+ pipeline->allocDrawable(this);
+ mDrawable->setLit(FALSE);
+ mDrawable->setRenderType(LLPipeline::RENDER_TYPE_HUD);
+ return mDrawable;
+}
+
+LLVector3 LLVOHUDPartGroup::getCameraPosition() const
+{
+ return LLVector3(-1,0,0);
+}