aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerpartsim.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerpartsim.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/linden/indra/newview/llviewerpartsim.cpp b/linden/indra/newview/llviewerpartsim.cpp
index d27e0df..95fb307 100644
--- a/linden/indra/newview/llviewerpartsim.cpp
+++ b/linden/indra/newview/llviewerpartsim.cpp
@@ -116,7 +116,8 @@ void LLViewerPart::init(LLPointer<LLViewerPartSource> sourcep, LLViewerImage *im
116// 116//
117 117
118 118
119LLViewerPartGroup::LLViewerPartGroup(const LLVector3 &center_agent, const F32 box_side) 119LLViewerPartGroup::LLViewerPartGroup(const LLVector3 &center_agent, const F32 box_side, bool hud)
120 : mHud(hud)
120{ 121{
121 LLMemType mt(LLMemType::MTYPE_PARTICLES); 122 LLMemType mt(LLMemType::MTYPE_PARTICLES);
122 mVOPartGroupp = NULL; 123 mVOPartGroupp = NULL;
@@ -133,7 +134,14 @@ LLViewerPartGroup::LLViewerPartGroup(const LLVector3 &center_agent, const F32 bo
133 mCenterAgent = center_agent; 134 mCenterAgent = center_agent;
134 mBoxRadius = F_SQRT3*box_side*0.5f; 135 mBoxRadius = F_SQRT3*box_side*0.5f;
135 136
137 if (mHud)
138 {
139 mVOPartGroupp = (LLVOPartGroup *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_HUD_PART_GROUP, getRegion());
140 }
141 else
142 {
136 mVOPartGroupp = (LLVOPartGroup *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_PART_GROUP, getRegion()); 143 mVOPartGroupp = (LLVOPartGroup *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_PART_GROUP, getRegion());
144 }
137 mVOPartGroupp->setViewerPartGroup(this); 145 mVOPartGroupp->setViewerPartGroup(this);
138 mVOPartGroupp->setPositionAgent(getCenterAgent()); 146 mVOPartGroupp->setPositionAgent(getCenterAgent());
139 F32 scale = box_side * 0.5f; 147 F32 scale = box_side * 0.5f;
@@ -223,6 +231,12 @@ BOOL LLViewerPartGroup::posInGroup(const LLVector3 &pos, const F32 desired_size)
223BOOL LLViewerPartGroup::addPart(LLViewerPart* part, F32 desired_size) 231BOOL LLViewerPartGroup::addPart(LLViewerPart* part, F32 desired_size)
224{ 232{
225 LLMemType mt(LLMemType::MTYPE_PARTICLES); 233 LLMemType mt(LLMemType::MTYPE_PARTICLES);
234
235 if (part->mFlags & LLPartData::LL_PART_HUD && !mHud)
236 {
237 return FALSE;
238 }
239
226 BOOL uniform_part = part->mScale.mV[0] == part->mScale.mV[1] && 240 BOOL uniform_part = part->mScale.mV[0] == part->mScale.mV[1] &&
227 !(part->mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK); 241 !(part->mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK);
228 242
@@ -530,7 +544,7 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part)
530 if(!return_group) 544 if(!return_group)
531 { 545 {
532 llassert_always(part->mPosAgent.isFinite()); 546 llassert_always(part->mPosAgent.isFinite());
533 LLViewerPartGroup *groupp = createViewerPartGroup(part->mPosAgent, desired_size); 547 LLViewerPartGroup *groupp = createViewerPartGroup(part->mPosAgent, desired_size, part->mFlags & LLPartData::LL_PART_HUD);
534 groupp->mUniformParticles = (part->mScale.mV[0] == part->mScale.mV[1] && 548 groupp->mUniformParticles = (part->mScale.mV[0] == part->mScale.mV[1] &&
535 !(part->mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK)); 549 !(part->mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK));
536 if (!groupp->addPart(part)) 550 if (!groupp->addPart(part))
@@ -555,12 +569,12 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part)
555 return return_group ; 569 return return_group ;
556} 570}
557 571
558LLViewerPartGroup *LLViewerPartSim::createViewerPartGroup(const LLVector3 &pos_agent, const F32 desired_size) 572LLViewerPartGroup *LLViewerPartSim::createViewerPartGroup(const LLVector3 &pos_agent, const F32 desired_size, bool hud)
559{ 573{
560 LLMemType mt(LLMemType::MTYPE_PARTICLES); 574 LLMemType mt(LLMemType::MTYPE_PARTICLES);
561 //find a box that has a center position divisible by PART_SIM_BOX_SIDE that encompasses 575 //find a box that has a center position divisible by PART_SIM_BOX_SIDE that encompasses
562 //pos_agent 576 //pos_agent
563 LLViewerPartGroup *groupp = new LLViewerPartGroup(pos_agent, desired_size); 577 LLViewerPartGroup *groupp = new LLViewerPartGroup(pos_agent, desired_size, hud);
564 mViewerPartGroups.push_back(groupp); 578 mViewerPartGroups.push_back(groupp);
565 return groupp; 579 return groupp;
566} 580}