Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionDispatch/btUnionFind.cpp')
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionDispatch/btUnionFind.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btUnionFind.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btUnionFind.cpp
index 046f348a147..62254335796 100644
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btUnionFind.cpp
+++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btUnionFind.cpp
@@ -15,7 +15,6 @@ subject to the following restrictions:
#include "btUnionFind.h"
#include <assert.h>
-#include <algorithm>
@@ -50,11 +49,16 @@ void btUnionFind::reset(int N)
}
}
-bool btUnionFindElementSortPredicate(const btElement& lhs, const btElement& rhs)
+
+class btUnionFindElementSortPredicate
{
- return lhs.m_id < rhs.m_id;
-}
+ public:
+ bool operator() ( const btElement& lhs, const btElement& rhs )
+ {
+ return lhs.m_id < rhs.m_id;
+ }
+};
///this is a special operation, destroying the content of btUnionFind.
///it sorts the elements, based on island id, in order to make it easy to iterate over islands
@@ -71,7 +75,9 @@ void btUnionFind::sortIslands()
}
// Sort the vector using predicate and std::sort
- std::sort(m_elements.begin(), m_elements.end(), btUnionFindElementSortPredicate);
+ //std::sort(m_elements.begin(), m_elements.end(), btUnionFindElementSortPredicate);
+ //perhaps use radix sort?
+ m_elements.heapSort(btUnionFindElementSortPredicate());
}