My camera class uses world->QueryAABB to get a list of bodies within the camera's view.
Because some bodies have multiple fixtures, those bodies are reported multiple times. I could probably put the bodies in a std::unorderd_set, but I was wondering if there was another solution.
Code:
class QueryCallback final : public b2QueryCallback
{
public:
bool ReportFixture( b2Fixture* fixture ) override
{
found_.push_back( fixture->GetBody() );
return true;
}
std::list< b2Body* > found_;
};
{
public:
bool ReportFixture( b2Fixture* fixture ) override
{
found_.push_back( fixture->GetBody() );
return true;
}
std::list< b2Body* > found_;
};
Because some bodies have multiple fixtures, those bodies are reported multiple times. I could probably put the bodies in a std::unorderd_set, but I was wondering if there was another solution.