summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerpartsim.cpp
diff options
context:
space:
mode:
authorMark Palange <palange@lindenlab.com>2008-11-07 17:51:03 +0000
committerMark Palange <palange@lindenlab.com>2008-11-07 17:51:03 +0000
commitf89f19990cbb9f3f2e7473ac6c159098bdfabec7 (patch)
treee7fa406e2db5e9adc2e24e00557d7b3d3f93203a /indra/newview/llviewerpartsim.cpp
parentb2bfb128e7d30e1cdb293a2ac192a0cbe63fe528 (diff)
QAR-992 Merging revisions 101012-101170,101686-101687 of svn+ssh://svn.lindenlab.com/svn/linden/qa/viewer_combo_1-22-merge into linden/release
Diffstat (limited to 'indra/newview/llviewerpartsim.cpp')
-rw-r--r--indra/newview/llviewerpartsim.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp
index 779ef0a3c6..5ac97930d3 100644
--- a/indra/newview/llviewerpartsim.cpp
+++ b/indra/newview/llviewerpartsim.cpp
@@ -116,7 +116,8 @@ void LLViewerPart::init(LLPointer<LLViewerPartSource> sourcep, LLViewerImage *im
//
-LLViewerPartGroup::LLViewerPartGroup(const LLVector3 &center_agent, const F32 box_side)
+LLViewerPartGroup::LLViewerPartGroup(const LLVector3 &center_agent, const F32 box_side, bool hud)
+ : mHud(hud)
{
LLMemType mt(LLMemType::MTYPE_PARTICLES);
mVOPartGroupp = NULL;
@@ -133,7 +134,14 @@ LLViewerPartGroup::LLViewerPartGroup(const LLVector3 &center_agent, const F32 bo
mCenterAgent = center_agent;
mBoxRadius = F_SQRT3*box_side*0.5f;
+ if (mHud)
+ {
+ mVOPartGroupp = (LLVOPartGroup *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_HUD_PART_GROUP, getRegion());
+ }
+ else
+ {
mVOPartGroupp = (LLVOPartGroup *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_PART_GROUP, getRegion());
+ }
mVOPartGroupp->setViewerPartGroup(this);
mVOPartGroupp->setPositionAgent(getCenterAgent());
F32 scale = box_side * 0.5f;
@@ -223,6 +231,12 @@ BOOL LLViewerPartGroup::posInGroup(const LLVector3 &pos, const F32 desired_size)
BOOL LLViewerPartGroup::addPart(LLViewerPart* part, F32 desired_size)
{
LLMemType mt(LLMemType::MTYPE_PARTICLES);
+
+ if (part->mFlags & LLPartData::LL_PART_HUD && !mHud)
+ {
+ return FALSE;
+ }
+
BOOL uniform_part = part->mScale.mV[0] == part->mScale.mV[1] &&
!(part->mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK);
@@ -530,7 +544,7 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part)
if(!return_group)
{
llassert_always(part->mPosAgent.isFinite());
- LLViewerPartGroup *groupp = createViewerPartGroup(part->mPosAgent, desired_size);
+ LLViewerPartGroup *groupp = createViewerPartGroup(part->mPosAgent, desired_size, part->mFlags & LLPartData::LL_PART_HUD);
groupp->mUniformParticles = (part->mScale.mV[0] == part->mScale.mV[1] &&
!(part->mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK));
if (!groupp->addPart(part))
@@ -555,12 +569,12 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part)
return return_group ;
}
-LLViewerPartGroup *LLViewerPartSim::createViewerPartGroup(const LLVector3 &pos_agent, const F32 desired_size)
+LLViewerPartGroup *LLViewerPartSim::createViewerPartGroup(const LLVector3 &pos_agent, const F32 desired_size, bool hud)
{
LLMemType mt(LLMemType::MTYPE_PARTICLES);
//find a box that has a center position divisible by PART_SIM_BOX_SIDE that encompasses
//pos_agent
- LLViewerPartGroup *groupp = new LLViewerPartGroup(pos_agent, desired_size);
+ LLViewerPartGroup *groupp = new LLViewerPartGroup(pos_agent, desired_size, hud);
mViewerPartGroups.push_back(groupp);
return groupp;
}