I have spent ages looking through posts on this issue and I am still having problems with the callbacks...
I want to find if a body is resting on another....
This is the idea but I don't know how to customize it to return if there is a contact...
Thanks
I want to find if a body is resting on another....
Code:
b2Body *guy;
void check_jump(void)
{
b2AABB aabb;
b2Vec2 guy_pos;
b2QueryCallback *callback;
guy_pos = guy->GetPosition();
aabb.lowerBound.Set(guy_pos.x - 0.01, guy_pos.y - 0.015);
aabb.upperBound.Set(guy_pos.x + 0.01, guy_pos.y - 0.010);
world->QueryAABB(callback, aabb);
// if (callback.contact)
there is contact = 1;
}
void check_jump(void)
{
b2AABB aabb;
b2Vec2 guy_pos;
b2QueryCallback *callback;
guy_pos = guy->GetPosition();
aabb.lowerBound.Set(guy_pos.x - 0.01, guy_pos.y - 0.015);
aabb.upperBound.Set(guy_pos.x + 0.01, guy_pos.y - 0.010);
world->QueryAABB(callback, aabb);
// if (callback.contact)
there is contact = 1;
}
This is the idea but I don't know how to customize it to return if there is a contact...
Thanks