Use std::vector<> instead of QVector

This commit is contained in:
David Rowe 2018-03-13 09:53:25 +13:00
parent 5acc605ba0
commit 945858876e
3 changed files with 11 additions and 8 deletions

View file

@ -78,14 +78,17 @@ int AnimSkeleton::getParentIndex(int jointIndex) const {
return _joints[jointIndex].parentIndex; return _joints[jointIndex].parentIndex;
} }
QVector<int> AnimSkeleton::getChildrenOfJoint(int jointIndex) const { std::vector<int> AnimSkeleton::getChildrenOfJoint(int jointIndex) const {
// Children and grandchildren, etc. // Children and grandchildren, etc.
QVector<int> result; std::vector<int> result;
if (jointIndex != -1) {
for (int i = jointIndex + 1; i < (int)_joints.size(); i++) { for (int i = jointIndex + 1; i < (int)_joints.size(); i++) {
if (_joints[i].parentIndex == jointIndex || result.contains(_joints[i].parentIndex)) { if (_joints[i].parentIndex == jointIndex
|| (std::find(result.begin(), result.end(), _joints[i].parentIndex) != result.end())) {
result.push_back(i); result.push_back(i);
} }
} }
}
return result; return result;
} }

View file

@ -43,7 +43,7 @@ public:
const AnimPose& getPostRotationPose(int jointIndex) const; const AnimPose& getPostRotationPose(int jointIndex) const;
int getParentIndex(int jointIndex) const; int getParentIndex(int jointIndex) const;
QVector<int> getChildrenOfJoint(int jointIndex) const; std::vector<int> getChildrenOfJoint(int jointIndex) const;
AnimPose getAbsolutePose(int jointIndex, const AnimPoseVec& relativePoses) const; AnimPose getAbsolutePose(int jointIndex, const AnimPoseVec& relativePoses) const;

View file

@ -269,8 +269,8 @@ protected:
int _leftEyeJointIndex { -1 }; int _leftEyeJointIndex { -1 };
int _rightEyeJointIndex { -1 }; int _rightEyeJointIndex { -1 };
QVector<int> _leftEyeJointChildren; std::vector<int> _leftEyeJointChildren;
QVector<int> _rightEyeJointChildren; std::vector<int> _rightEyeJointChildren;
int _leftHandJointIndex { -1 }; int _leftHandJointIndex { -1 };
int _leftElbowJointIndex { -1 }; int _leftElbowJointIndex { -1 };