for (b2Body* b = world->GetBodyList(); b; b = b->GetNext())
{
if (b->GetType() == b2_dynamicBody)
{
b2Shape* shape = b->GetFixtureList()->GetShape();
b2Transform transform(b->GetPosition(), b2Rot(b->GetAngle()));
b2Vec2 point(location.x/PTM_RATIO,location.y/PTM_RATIO);
bool hit = shape->TestPoint(transform, point);
if (hit)
{
clickAtBox = true;
break;
}
}
if (clickAtBox)
break;
}
{
if (b->GetType() == b2_dynamicBody)
{
b2Shape* shape = b->GetFixtureList()->GetShape();
b2Transform transform(b->GetPosition(), b2Rot(b->GetAngle()));
b2Vec2 point(location.x/PTM_RATIO,location.y/PTM_RATIO);
bool hit = shape->TestPoint(transform, point);
if (hit)
{
clickAtBox = true;
break;
}
}
if (clickAtBox)
break;
}