EgtGeomKernel :

- migliorie varie a Collision Avoidance di Tools.
This commit is contained in:
Dario Sassi
2018-07-23 06:06:16 +00:00
parent 371c00d13b
commit 280d414e30
6 changed files with 70 additions and 44 deletions
+5 -6
View File
@@ -27,7 +27,7 @@ const size_t occupiedCellsVectorSize = 256 ;
const size_t minimalGridDensity = 8 ;
const size_t gridActivationThreshold = 64 ;
const double hierarchyFactor = 2 ;
const double MIN_CELL_SIZE = 20.0 ;
const double MIN_CELL_SIZE = 5.0 ;
//----------------------------------------------------------------------------
// HashGrid2d
@@ -447,7 +447,7 @@ HashGrid2d::Enlarge( void)
InitNeighborOffsets() ;
// ... all previously removed objs are reinserted.
for ( auto p = PObjVecTemp.begin() ; p < PObjVecTemp.end() ; ++ p) {
for ( auto p = PObjVecTemp.begin() ; p < PObjVecTemp.end() ; ++ p) {
Add( **p) ;
}
}
@@ -657,7 +657,7 @@ HashGrids2d::Find( const BBox3d& b3Test, INTVECTOR& vnIds)
sort( vnIds.begin(), vnIds.end()) ;
vnIds.erase( unique( vnIds.begin(), vnIds.end()), vnIds.end()) ;
return ( vnIds.size() > 0) ;
return ( vnIds.size() > 0) ;
}
@@ -685,7 +685,7 @@ HashGrids2d::addGrid( ObjData& obj)
obj.box.GetDiameter( size) ;
// If the body is finite in size, it must be assigned to a grid with suitably sized cells.
if ( size > 0) {
if ( size > - EPS_ZERO) {
size = max( size, MIN_CELL_SIZE) ;
@@ -777,6 +777,5 @@ HashGrids2d::addList( ObjData& obj)
obj.pHGrid = nullptr ;
obj.nHash = m_nonGridObjs.size() ;
obj.nCellId = 1 ;
m_nonGridObjs.push_back( &obj) ;
m_nonGridObjs.push_back( &obj) ;
}