summaryrefslogtreecommitdiff
path: root/indra/llappearance/llpolymorph.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2023-06-01 09:56:41 -0400
committerNat Goodspeed <nat@lindenlab.com>2023-06-01 09:56:41 -0400
commit7d05ade3f10563e8c202106e00cb3d273ab13338 (patch)
tree349ecda36a5a561d6e564e2cc3db39121fd8946b /indra/llappearance/llpolymorph.cpp
parented92f1d8034dcaa84f808b3267c772202e7ce113 (diff)
parent5a70639b7992842a9f74ec81b11bac56608b8f2e (diff)
SL-18330: Merge branch 'main' of secondlife/viewer into xcode-14.3
Diffstat (limited to 'indra/llappearance/llpolymorph.cpp')
-rw-r--r--indra/llappearance/llpolymorph.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp
index 84dd6156a9..965b999bd4 100644
--- a/indra/llappearance/llpolymorph.cpp
+++ b/indra/llappearance/llpolymorph.cpp
@@ -363,18 +363,16 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
setWeight(getDefaultWeight());
LLAvatarAppearance* avatarp = mMesh->getAvatar();
- LLPolyMorphTargetInfo::volume_info_list_t::iterator iter;
- for (iter = getInfo()->mVolumeInfoList.begin(); iter != getInfo()->mVolumeInfoList.end(); iter++)
+ for (LLPolyVolumeMorphInfo& volume_info : getInfo()->mVolumeInfoList)
{
- LLPolyVolumeMorphInfo *volume_info = &(*iter);
for (S32 i = 0; i < avatarp->mNumCollisionVolumes; i++)
{
- if (avatarp->mCollisionVolumes[i].getName() == volume_info->mName)
+ if (avatarp->mCollisionVolumes[i].getName() == volume_info.mName)
{
mVolumeMorphs.push_back(
LLPolyVolumeMorph(&avatarp->mCollisionVolumes[i],
- volume_info->mScale,
- volume_info->mPos));
+ volume_info.mScale,
+ volume_info.mPos));
break;
}
}
@@ -641,15 +639,14 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
}
// now apply volume changes
- for( volume_list_t::iterator iter = mVolumeMorphs.begin(); iter != mVolumeMorphs.end(); iter++ )
+ for(LLPolyVolumeMorph& volume_morph : mVolumeMorphs)
{
- LLPolyVolumeMorph* volume_morph = &(*iter);
- LLVector3 scale_delta = volume_morph->mScale * delta_weight;
- LLVector3 pos_delta = volume_morph->mPos * delta_weight;
+ LLVector3 scale_delta = volume_morph.mScale * delta_weight;
+ LLVector3 pos_delta = volume_morph.mPos * delta_weight;
- volume_morph->mVolume->setScale(volume_morph->mVolume->getScale() + scale_delta);
+ volume_morph.mVolume->setScale(volume_morph.mVolume->getScale() + scale_delta);
// SL-315
- volume_morph->mVolume->setPosition(volume_morph->mVolume->getPosition() + pos_delta);
+ volume_morph.mVolume->setPosition(volume_morph.mVolume->getPosition() + pos_delta);
}
}
@@ -735,15 +732,14 @@ void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3
void LLPolyMorphTarget::applyVolumeChanges(F32 delta_weight)
{
// now apply volume changes
- for( volume_list_t::iterator iter = mVolumeMorphs.begin(); iter != mVolumeMorphs.end(); iter++ )
+ for(LLPolyVolumeMorph& volume_morph : mVolumeMorphs)
{
- LLPolyVolumeMorph* volume_morph = &(*iter);
- LLVector3 scale_delta = volume_morph->mScale * delta_weight;
- LLVector3 pos_delta = volume_morph->mPos * delta_weight;
+ LLVector3 scale_delta = volume_morph.mScale * delta_weight;
+ LLVector3 pos_delta = volume_morph.mPos * delta_weight;
- volume_morph->mVolume->setScale(volume_morph->mVolume->getScale() + scale_delta);
+ volume_morph.mVolume->setScale(volume_morph.mVolume->getScale() + scale_delta);
// SL-315
- volume_morph->mVolume->setPosition(volume_morph->mVolume->getPosition() + pos_delta);
+ volume_morph.mVolume->setPosition(volume_morph.mVolume->getPosition() + pos_delta);
}
}