after trying out several physics libraries, tutorials and similar engines I stumbled on Box2D which more or less seems to do exactly what I need.
However, I'm using g++ and it doesn't want to compile. I get three errors (of the same kind):
Code: Select all
passing 'const Arbiter' as 'this' argument of 'void Arbiter::Update(Contact*, int)' discards qualifiers
Now, I did some research and I wasn't the first to run into this problem. On a blog (gbgames . com / blog/?p=444) a solution was offered for the two occations in World::Step , but that solution isn't applicable to the the first error.
In short, the line that's giving me problems is this one: (should be line 63 in World.cpp)
Code: Select all
(*arb).Update(newArb.contacts, newArb.numContacts);
Code: Select all
// new code from that blog
ArbIter arb = arbiters.begin();
while (arb != arbiters.end())
{
// Erase key from set, modify it, then add it again.
Arbiter newArb((*arb).body1, (*arb).body2);
newArb.ApplyImpulse();
arbiters.erase(arb++);
arbiters.insert(newArb);
}
/* old code
for (ArbIter arb = arbiters.begin(); arb != arbiters.end(); ++arb)
{
(*arb).ApplyImpulse();
}
*/
Thank you in advance!
ps. I tried to post a link to that blog but your spam filter said no.