Page 1 of 1

0.8.0 World:setCallbacks help

Posted: Wed Jan 11, 2012 7:02 am
by ZenX2
I'm making a game in Love 0.8.0, but I've hit a bit of a bump.

It seems that the way that callbacks work in 0.8.0 is different than 0.7. I've managed with just the source code for quite a few things, but I'm wondering if I could get an explanation of the differences/how it works in 0.8.0.

Thank you for reading my request for help, please answer if you can and have a nice day. :crazy:

Re: 0.8.0 World:setCallbacks help

Posted: Wed Jan 11, 2012 8:12 am
by kikito
0.8.x comes with a complete rework on the physics. I dind't know about the callbacks specifically, but a lot of stuff will change.

Re: 0.8.0 World:setCallbacks help

Posted: Wed Jan 11, 2012 12:30 pm
by slime
The callbacks are explained here: http://www.box2d.org/manual.html
The only major difference between the LÖVE 0.8.0 API and the official box2d API is that there are no manifolds in the LÖVE one.

Re: 0.8.0 World:setCallbacks help

Posted: Wed Jan 11, 2012 12:47 pm
by coffee
ZenX2 wrote: but I'm wondering if I could get an explanation of the differences/how it works in 0.8.0.
I would request some help or some orientation on this. I'm doing stuff in 0.7.2 and I don't know the general modifications in 0.8 that will make my code break compatibility. There is a list of 0.8 modifications that warns what it's need to make our old code works in 0.8 ?

Re: 0.8.0 World:setCallbacks help

Posted: Thu Jan 12, 2012 2:24 am
by ZenX2
One of the most major difference between the physics in 0.7 and 0.8 is fixtures.

I tried a bit harder to figure out where love was handling the callbacks and pushing them back to the lua state, and with some debugging I found the arguments:

1. Fixture A
2. Fixture B
3. The Contact
4. normalImpulses
5. tangentImpulses

Definitely better that passing the userdata.

Also, there's an incorrect comment on line 68 of src/modules/physics/box2d/World.cpp; it still talks about pushing userdata, instead of fixtures.