I recently upgraded the version of box2d to v2.2.1 in a long-running project, and it caused a number of backward-compatibility issues with existing project code. Most were resolved, except for this one
b2Fixture *f = body->GetFixtureList();
b2RayCastOutput output;
b2RayCastInput input;
f->RayCast(&output, input) // broken call
is now broken, expecting a 3rd argument. I see in the box2d source code that the function signature is
inline bool b2Fixture::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const;
but I can't find any examples of what childIndex
is supposed to be. Can someone provide an example of how to use this updated RayCast function?
EDIT: I notice that setting childIndex
to 0 seems to work, but I don't know why.