SpatialSort: use std::vector::clear().
parent
ab45dc79fa
commit
428a4cdd71
|
@ -48,7 +48,6 @@ the 3ds loader handling smooth groups correctly */
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SGSpatialSort::SGSpatialSort()
|
SGSpatialSort::SGSpatialSort()
|
||||||
{
|
{
|
||||||
|
@ -89,12 +88,11 @@ void SGSpatialSort::FindPositions( const aiVector3D& pPosition,
|
||||||
float dist = pPosition * mPlaneNormal;
|
float dist = pPosition * mPlaneNormal;
|
||||||
float minDist = dist - pRadius, maxDist = dist + pRadius;
|
float minDist = dist - pRadius, maxDist = dist + pRadius;
|
||||||
|
|
||||||
// clear the array in this strange fashion because a simple clear() would also deallocate
|
// clear the array
|
||||||
// the array which we want to avoid
|
poResults.clear();
|
||||||
poResults.erase( poResults.begin(), poResults.end());
|
|
||||||
|
|
||||||
// quick check for positions outside the range
|
// quick check for positions outside the range
|
||||||
if( mPositions.size() == 0)
|
if( mPositions.empty() )
|
||||||
return;
|
return;
|
||||||
if( maxDist < mPositions.front().mDistance)
|
if( maxDist < mPositions.front().mDistance)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue