revert quickSort change in commit http://code.google.com/p/bullet/source/detail?r=2527 and fix the underlying sort issue
in VoronoiFractureDemo (store intermediate values in memory to avoid problems) @todo: rewrite the island management to avoid sort for better performance Thanks to Peter Kyme for the report, fixes Issue 607
This commit is contained in:
@@ -184,7 +184,12 @@ struct pointCmp
|
||||
{
|
||||
bool operator()(const btVector3& p1, const btVector3& p2) const
|
||||
{
|
||||
return ((p1-curVoronoiPoint).length2() < (p2-curVoronoiPoint).length2());
|
||||
float v1 = (p1-curVoronoiPoint).length2();
|
||||
float v2 = (p2-curVoronoiPoint).length2();
|
||||
bool result0 = v1 < v2;
|
||||
//bool result1 = ((btScalar)(p1-curVoronoiPoint).length2()) < ((btScalar)(p2-curVoronoiPoint).length2());
|
||||
//apparently result0 is not always result1, because extended precision used in registered is different from precision when values are stored in memory
|
||||
return result0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user