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:
authorErwin Coumans <blender@erwincoumans.com>2007-06-23 09:28:07 +0400
committerErwin Coumans <blender@erwincoumans.com>2007-06-23 09:28:07 +0400
commitca26aeb7b23e37e65f49d907ea53fcaeee77ad4e (patch)
treeb6530195a8ef5d874b9fc2bbb9574f1484781be5 /extern/bullet2/src/BulletCollision/CollisionDispatch/btUnionFind.cpp
parent14ad8c9941ac1e6f5252a843c6ad17653cbbd689 (diff)
upgrade to latest Bullet 2.53. cross the fingers it doesn't break one of the exotic or less exotic platforms
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());
}