summaryrefslogtreecommitdiff
path: root/indra/llcharacter/lljoint.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-04-26 19:40:09 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-04-26 19:40:09 +0300
commit231dea378babc0ee9806f0fcd68283e79f81d2eb (patch)
treed4e42cf3ea6c212ffb1e2958f6cb6568ac5bdd0a /indra/llcharacter/lljoint.cpp
parente77134ea898cd19fdba716e46324b2945ef6826f (diff)
parentd7f1c88c35849e56f5b352f13c16a08467d1533b (diff)
Merge branch 'master' into DRTVWR-486
Diffstat (limited to 'indra/llcharacter/lljoint.cpp')
-rw-r--r--indra/llcharacter/lljoint.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index e2f512f86e..a685df5925 100644
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -209,7 +209,7 @@ void LLJoint::touch(U32 flags)
child_flags |= POSITION_DIRTY;
}
- for (child_list_t::iterator iter = mChildren.begin();
+ for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
LLJoint* joint = *iter;
@@ -251,7 +251,7 @@ LLJoint *LLJoint::findJoint( const std::string &name )
if (name == getName())
return this;
- for (child_list_t::iterator iter = mChildren.begin();
+ for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
LLJoint* joint = *iter;
@@ -286,7 +286,7 @@ void LLJoint::addChild(LLJoint* joint)
//--------------------------------------------------------------------
void LLJoint::removeChild(LLJoint* joint)
{
- child_list_t::iterator iter = std::find(mChildren.begin(), mChildren.end(), joint);
+ joints_t::iterator iter = std::find(mChildren.begin(), mChildren.end(), joint);
if (iter != mChildren.end())
{
mChildren.erase(iter);
@@ -303,16 +303,17 @@ void LLJoint::removeChild(LLJoint* joint)
//--------------------------------------------------------------------
void LLJoint::removeAllChildren()
{
- for (child_list_t::iterator iter = mChildren.begin();
- iter != mChildren.end();)
+ for (LLJoint* joint : mChildren)
{
- child_list_t::iterator curiter = iter++;
- LLJoint* joint = *curiter;
- mChildren.erase(curiter);
- joint->mXform.setParent(NULL);
- joint->mParent = NULL;
- joint->touch();
+ if (joint)
+ {
+ joint->mXform.setParent(NULL);
+ joint->mParent = NULL;
+ joint->touch();
+ //delete joint;
+ }
}
+ mChildren.clear();
}
@@ -985,7 +986,7 @@ void LLJoint::updateWorldMatrixChildren()
{
updateWorldMatrix();
}
- for (child_list_t::iterator iter = mChildren.begin();
+ for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
LLJoint* joint = *iter;
@@ -1031,7 +1032,7 @@ void LLJoint::clampRotation(LLQuaternion old_rot, LLQuaternion new_rot)
{
LLVector3 main_axis(1.f, 0.f, 0.f);
- for (child_list_t::iterator iter = mChildren.begin();
+ for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
LLJoint* joint = *iter;