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

View file

@ -43,7 +43,7 @@ public:
const AnimPose& getPostRotationPose(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;

View file

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