Commit bda54a3c authored by Matthias Möller's avatar Matthias Möller
Browse files

irgnoring root joint when iterate through the skeleton searching for the bone lengths

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13638 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 60106812
......@@ -265,11 +265,14 @@ double InfoSkeletonObjectPlugin::minBoneLength(int _skeletonID)
double min = std::numeric_limits<double>::max();
for (Skeleton::Iterator iter = skeleton->begin(); iter != skeleton->end(); ++iter)
{
if (!iter->isRoot())
{
double length = boneLength(_skeletonID,iter->id());
if (length < min)
min = length;
}
}
return min;
}
......@@ -292,11 +295,14 @@ double InfoSkeletonObjectPlugin::maxBoneLength(int _skeletonID)
double max = std::numeric_limits<double>::min();
for (Skeleton::Iterator iter = skeleton->begin(); iter != skeleton->end(); ++iter)
{
if (!iter->isRoot())
{
double length = boneLength(_skeletonID,iter->id());
if (length > max)
max = length;
}
}
return max;
}
......@@ -320,10 +326,13 @@ double InfoSkeletonObjectPlugin::meanBoneLength(int _skeletonID)
double sum = 0;
unsigned int count = 0;
for (Skeleton::Iterator iter = skeleton->begin(); iter != skeleton->end(); ++iter)
{
if (!iter->isRoot())
{
sum += boneLength(_skeletonID,iter->id());
++count;
}
}
return (sum/static_cast<double>(count));
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment