Code: Select all
// make a integer
int delcount = 0;
// pair creation
std::pair<btCollisionShape*,INode*> * pairDel;
pairDel = new std::pair<btCollisionShape*, INode*>[maxscene->NumChildren()];
// make a shape
groundShape = new btStaticPlaneShape(btVector3(0, 1, 0), 1);
// add that shape to pair
pairDel[delcount].first = groundShape;
delcount += 1;
// loop to delcount and delete the bt collision shapes that are stored in the pair
for ( int j=0; j<delcount; j++ )
{
btCollisionShape* shape = pairDel[j].first;
delete shape;
}