Through the debugger, the BBox object is in order of access to the function, but as soon as it enters this function, the vfptr object points to 0xccccc. I do not understand.
- What causes this?
- Why is there a link to a virtual table where the object is not derived from another class. (Although it is located in the GameObject from which my Player class is inherited, and I retrieve the BBox from within the player. But why does the BBox have a link? Isn't it the player that should be supported in this link?)
For 1; some code for reference:
and. I remove the bounding box from the player. This returns the frame as expected. Then I submit my address to GetGridCells.
const BoundingBox& l_Bbox = l_pPlayer->GetBoundingBox();
boost::unordered_set < Cell*, CellPHash >& l_GridCells = GetGridCells ( &l_Bbox );
B. Here a_pBoundingBox goes crazy and gets this garbage value.
boost::unordered_set< Cell*, CellPHash > CollisionMgr::GetGridCells(const BoundingBox *a_pBoundingBox)
{
, , :
const BoundingBox& Player::GetBoundingBox(void)
{
return BoundingBox( &GetBoundingSphere() );
}
const BoundingSphere& Player::GetBoundingSphere(void)
{
BoundingSphere& l_BSphere = m_pGeomMesh->m_BoundingSphere;
l_BSphere.m_Center = GetPosition();
return l_BSphere;
}
BoundingBox(const BoundingSphere* a_pBoundingSphere);
-, , , ? , , , , .
!