//----------------------------------------------------------------// void MOAIPartitionLevel::GatherProps ( MOAIPartitionResultBuffer& results, MOAIProp* ignore, const ZLVec3D& point, u32 planeID, u32 mask ) { ZLVec2D cellPoint ( 0.0f, 0.0f ); switch ( planeID ) { case ZLBox::PLANE_XY: cellPoint.Init ( point.mX, point.mY ); break; case ZLBox::PLANE_XZ: cellPoint.Init ( point.mX, point.mZ ); break; case ZLBox::PLANE_YZ: cellPoint.Init ( point.mY, point.mZ ); break; }; float halfSize = this->mCellSize * 0.5f; cellPoint.mX = cellPoint.mX - halfSize; cellPoint.mY = cellPoint.mY + halfSize; MOAICellCoord coord = this->mGridSpace.GetCellCoord ( cellPoint.mX, cellPoint.mY ); int width = this->mGridSpace.GetWidth (); int height = this->mGridSpace.GetHeight (); int xTotal = ( width < 2 ) ? 1 : 2; int yTotal = ( height < 2 ) ? 1 : 2; for ( int y = 0; y < yTotal; ++y ) { for ( int x = 0; x < xTotal; ++x ) { MOAICellCoord offset = this->mGridSpace.WrapCellCoord ( coord.mX + x, coord.mY - y ); int addr = this->mGridSpace.GetCellAddr ( offset ); this->mCells [ addr ].GatherProps ( results, ignore, point, mask ); } } }