summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerpartsim.cpp
diff options
context:
space:
mode:
authorskolb <none@none>2009-12-01 13:34:16 -0800
committerskolb <none@none>2009-12-01 13:34:16 -0800
commit0ab6d36094cc52eea063f6d3b05262c111857f29 (patch)
tree95840e0bf49f744520649b030d4bd65b99275bcf /indra/newview/llviewerpartsim.cpp
parent6dd3f54924b57224298f6d76c766b403d165783f (diff)
parent6a888b653a1ee5ed0eeedd8994ff59652f2913aa (diff)
Merge
Diffstat (limited to 'indra/newview/llviewerpartsim.cpp')
-rw-r--r--indra/newview/llviewerpartsim.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp
index cfb8340462..841a7ccc5e 100644
--- a/indra/newview/llviewerpartsim.cpp
+++ b/indra/newview/llviewerpartsim.cpp
@@ -71,9 +71,9 @@ const F32 LLViewerPartSim::PART_ADAPT_RATE_MULT_RECIP = 1.0f/PART_ADAPT_RATE_MUL
U32 LLViewerPart::sNextPartID = 1;
-F32 calc_desired_size(LLVector3 pos, LLVector2 scale)
+F32 calc_desired_size(LLViewerCamera* camera, LLVector3 pos, LLVector2 scale)
{
- F32 desired_size = (pos-LLViewerCamera::getInstance()->getOrigin()).magVec();
+ F32 desired_size = (pos - camera->getOrigin()).magVec();
desired_size /= 4;
return llclamp(desired_size, scale.magVec()*0.5f, PART_SIM_BOX_SIDE*2);
}
@@ -273,6 +273,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt)
LLViewerPartSim::checkParticleCount(mParticles.size());
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
LLViewerRegion *regionp = getRegion();
S32 end = (S32) mParticles.size();
for (S32 i = 0 ; i < (S32)mParticles.size();)
@@ -394,7 +395,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt)
}
else
{
- F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale);
+ F32 desired_size = calc_desired_size(camera, part->mPosAgent, part->mScale);
if (!posInGroup(part->mPosAgent, desired_size))
{
// Transfer particles between groups
@@ -557,7 +558,8 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part)
}
else
{
- F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale);
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
+ F32 desired_size = calc_desired_size(camera, part->mPosAgent, part->mScale);
S32 count = (S32) mViewerPartGroups.size();
for (S32 i = 0; i < count; i++)