behdad / box2d

Automatically exported from code.google.com/p/box2d
2 stars 12 forks source link

b2QueryCallback::ReportFixture ignores return value? #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
perform a b2World::Query and return false from ReportFixture

What is the expected output? What do you see instead?
expect ReportFixture to only return one fixture (fire once per query)

What version of the product are you using? On what operating system?
box2d 2.0.2, rev4, ubuntu 9.04 64-bit

Please provide any additional information below.

Original issue reported on code.google.com by mnbaya...@gmail.com on 6 Sep 2009 at 2:35

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
code sample:

const QList<Object*>& World::query(const QRectF& rect, bool multiSelect) {
    b2AABB aabb;
    aabb.upperBound = b2Vec2(rect.left(), rect.top());
    aabb.lowerBound = b2Vec2(rect.right(), rect.bottom());
    m_queriedObjects.clear();
    m_multiSelect = multiSelect;
    printf("query:");
    m_world.Query(this, aabb);
    printf("\n");
    return m_queriedObjects;
}

bool World::ReportFixture(b2Fixture* f) {
    printf("x");
    m_queriedObjects.append(static_cast<Object*>(f->GetBody()->GetUserData()));
    return false;
}

sample output:
query:xx

(should only be one x)

Original comment by mnbaya...@gmail.com on 6 Sep 2009 at 2:48

GoogleCodeExporter commented 9 years ago
confirmed on box2d 2.1.0, rev10

Original comment by mnbaya...@gmail.com on 6 Sep 2009 at 2:59

GoogleCodeExporter commented 9 years ago

Original comment by erinca...@gmail.com on 20 Sep 2009 at 10:27