Thanks Seramus, I obviously talking to someone experienced here.
Unfortunately I am at a failiure to understand your code. I dont understand the overall concept of what you are trying to do. Are you building some sort of implicit grid? The _loop (your explaination doesn't account for all parameters). I'm having a little difficulty with what mechanism is. Maybe it's your entities. Why do you sort things.
Maybe if I could have a generic understanding of what you are trying to do. Although I can follow the program flow. I'll keep scanning it...
next possible error
m_pVec = &m_ppCollMap[iRow][vCell.iCol].m_vecCollisionEntities;
assert((m_pVec->begin() + (pEntityOne->m_iPositionInCell -1)) < m_pVec->end());
m_itToBeErased = m_pVec->begin() + (pEntityOne->m_iPositionInCell -1);
for (m_it = m_itToBeErased + 1; m_it != m_pVec->end(); ++m_it)
if (m_it > m_itToBeErased)
(*m_it)->m_iPositionInCell -= 1;//this line , why  for other entities that cell can be 5th 2nd 3rd ....
Great work - I just drew some diagrams to depict the problem and you're right. There is no way of telling which cell that particular entity overlaps...! Hmm how do I get over that problem...?
I am working on reducing the 9 cells down to 4...! changing CalculateCellUpon to calc the NW cell of 4 cells. Which should speed it up. I would use your code if I could understand it - Im just scared of using black boxes.
If I did use a list instead of a vector won't the addresses all change when I add a new element to the list causing it to be remade...?