0.8.0 World:setCallbacks help

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
ZenX2
Citizen
Posts: 89
Joined: Wed Nov 17, 2010 5:35 am

0.8.0 World:setCallbacks help

Post 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:
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: 0.8.0 World:setCallbacks help

Post 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.
When I write def I mean function.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: 0.8.0 World:setCallbacks help

Post 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.
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: 0.8.0 World:setCallbacks help

Post 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 ?
User avatar
ZenX2
Citizen
Posts: 89
Joined: Wed Nov 17, 2010 5:35 am

Re: 0.8.0 World:setCallbacks help

Post 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.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests