summaryrefslogtreecommitdiff
path: root/indra/llappearance
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-08-05 12:04:29 -0700
committerGraham Linden <graham@lindenlab.com>2019-08-05 12:04:29 -0700
commit76128c4357bc36acd54575153516c6d337fe4263 (patch)
tree7910d8415bf394fd15f5dca35dd3779b39acc15a /indra/llappearance
parent9bb6da1e76efa951da7e740f80b1e4e72e67b878 (diff)
SL-10566 Use vector for some high-traffic, low-item count containers instead of list.
Provide method of storing joint indices sep from weight data for faster runtime processing.
Diffstat (limited to 'indra/llappearance')
-rw-r--r--indra/llappearance/llavatarappearance.cpp18
-rw-r--r--indra/llappearance/llavatarjoint.cpp26
-rw-r--r--indra/llappearance/llavatarjointmesh.cpp2
-rw-r--r--indra/llappearance/lldriverparam.cpp2
-rw-r--r--indra/llappearance/llpolyskeletaldistortion.cpp2
5 files changed, 25 insertions, 25 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index 38cda2e2f1..0c0ad0d265 100644
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -81,8 +81,8 @@ public:
LLAvatarBoneInfo() : mIsJoint(FALSE) {}
~LLAvatarBoneInfo()
{
- std::for_each(mChildList.begin(), mChildList.end(), DeletePointer());
- mChildList.clear();
+ std::for_each(mChildren.begin(), mChildren.end(), DeletePointer());
+ mChildren.clear();
}
BOOL parseXml(LLXmlTreeNode* node);
@@ -96,8 +96,8 @@ private:
LLVector3 mRot;
LLVector3 mScale;
LLVector3 mPivot;
- typedef std::vector<LLAvatarBoneInfo*> child_list_t;
- child_list_t mChildList;
+ typedef std::vector<LLAvatarBoneInfo*> bones_t;
+ bones_t mChildren;
};
//------------------------------------------------------------------------
@@ -679,8 +679,8 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
// setup children
- LLAvatarBoneInfo::child_list_t::const_iterator iter;
- for (iter = info->mChildList.begin(); iter != info->mChildList.end(); ++iter)
+ LLAvatarBoneInfo::bones_t::const_iterator iter;
+ for (iter = info->mChildren.begin(); iter != info->mChildren.end(); ++iter)
{
LLAvatarBoneInfo *child_info = *iter;
if (!setupBone(child_info, joint, volume_num, joint_num))
@@ -1669,7 +1669,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
delete child_info;
return FALSE;
}
- mChildList.push_back(child_info);
+ mChildren.push_back(child_info);
}
return TRUE;
}
@@ -1728,8 +1728,8 @@ void LLAvatarAppearance::makeJointAliases(LLAvatarBoneInfo *bone_info)
mJointAliasMap[*i] = bone_name;
}
- LLAvatarBoneInfo::child_list_t::const_iterator iter;
- for (iter = bone_info->mChildList.begin(); iter != bone_info->mChildList.end(); ++iter)
+ LLAvatarBoneInfo::bones_t::const_iterator iter;
+ for (iter = bone_info->mChildren.begin(); iter != bone_info->mChildren.end(); ++iter)
{
makeJointAliases( *iter );
}
diff --git a/indra/llappearance/llavatarjoint.cpp b/indra/llappearance/llavatarjoint.cpp
index 29642be099..80b3e42b52 100644
--- a/indra/llappearance/llavatarjoint.cpp
+++ b/indra/llappearance/llavatarjoint.cpp
@@ -100,7 +100,7 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
//----------------------------------------------------------------
if (recursive)
{
- for (child_list_t::iterator iter = mChildren.begin();
+ for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
LLAvatarJoint* joint = (LLAvatarJoint*)(*iter);
@@ -118,10 +118,10 @@ void LLAvatarJoint::setSkeletonComponents( U32 comp, BOOL recursive )
mComponents = comp;
if (recursive)
{
- for (child_list_t::iterator iter = mChildren.begin();
+ for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
- LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(*iter);
joint->setSkeletonComponents(comp, recursive);
}
}
@@ -133,7 +133,7 @@ void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive)
if (recursive)
{
- for (child_list_t::iterator iter = mChildren.begin();
+ for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
LLAvatarJoint* joint = (LLAvatarJoint*)(*iter);
@@ -144,27 +144,27 @@ void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive)
void LLAvatarJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area)
{
- for (child_list_t::iterator iter = mChildren.begin();
+ for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
- LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(*iter);
joint->updateFaceSizes(num_vertices, num_indices, pixel_area);
}
}
void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update)
{
- for (child_list_t::iterator iter = mChildren.begin();
+ for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
- LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(*iter);
joint->updateFaceData(face, pixel_area, damp_wind, terse_update);
}
}
void LLAvatarJoint::updateJointGeometry()
{
- for (child_list_t::iterator iter = mChildren.begin();
+ for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
@@ -178,10 +178,10 @@ BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate)
BOOL lod_changed = FALSE;
BOOL found_lod = FALSE;
- for (child_list_t::iterator iter = mChildren.begin();
+ for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
- LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(*iter);
F32 jointLOD = joint->getLOD();
if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
@@ -207,10 +207,10 @@ BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate)
void LLAvatarJoint::dump()
{
- for (child_list_t::iterator iter = mChildren.begin();
+ for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
- LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
+ LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(*iter);
joint->dump();
}
}
diff --git a/indra/llappearance/llavatarjointmesh.cpp b/indra/llappearance/llavatarjointmesh.cpp
index 7ca0928171..0a23b1fda3 100644
--- a/indra/llappearance/llavatarjointmesh.cpp
+++ b/indra/llappearance/llavatarjointmesh.cpp
@@ -379,7 +379,7 @@ void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint)
}
// depth-first traversal
- for (LLJoint::child_list_t::iterator iter = current_joint->mChildren.begin();
+ for (LLJoint::joints_t::iterator iter = current_joint->mChildren.begin();
iter != current_joint->mChildren.end(); ++iter)
{
LLAvatarJoint* child_joint = (LLAvatarJoint*)(*iter);
diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp
index e5e502b158..05d26fbe7a 100644
--- a/indra/llappearance/lldriverparam.cpp
+++ b/indra/llappearance/lldriverparam.cpp
@@ -614,7 +614,7 @@ void LLDriverParam::setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight)
mAvatarAppearance->isValid() &&
driven->mParam->getCrossWearable())
{
- LLWearable* wearable = dynamic_cast<LLWearable*> (mWearablep);
+ LLWearable* wearable = mWearablep;
if (mAvatarAppearance->getWearableData()->isOnTop(wearable))
{
use_self = true;
diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp
index 5b77a7433a..ae38c25dbf 100644
--- a/indra/llappearance/llpolyskeletaldistortion.cpp
+++ b/indra/llappearance/llpolyskeletaldistortion.cpp
@@ -160,7 +160,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
mJointScales[joint] = bone_info->mScaleDeformation;
// apply to children that need to inherit it
- for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
+ for (LLJoint::joints_t::iterator iter = joint->mChildren.begin();
iter != joint->mChildren.end(); ++iter)
{
LLAvatarJoint* child_joint = (LLAvatarJoint*)(*iter);