I'm not too familiar with boost::any, but do you have to any_cast to a boost::any? Or can you just use the object directly? That is if ( boost::any_cast<boost::any> (contrl->getObject(i)).type() == typeid(Physics::Box2D) )
vs if ( contrl->getObject(i).type() == typeid(Physics::Box2D) )
Also, you can see if the cast is failing with:
try
{
any_cast<some type>(yourobject);
cout << "success";
}
catch(const boost::bad_any_cast &)
{
cout << "failure";
}
You should definitely make sure this cast succeeds:
any_cast<Box2D> (contrl->getObject(i) )
before calling .Info() on the result.