Page 2 of 2

Re: Update physics World in another Thread

Posted: Thu Jan 12, 2017 10:21 pm
by AntonioModer
I found the main critical problem.
Functions in http://www.love2d.org/wiki/World:setCallbacks works only in one thread and they cant pass to another.
Same for http://www.love2d.org/wiki/Fixture:setUserData and http://www.love2d.org/wiki/Body:setUserData if userData is table or function (pointer).

Re: Update physics World in another Thread

Posted: Thu Jan 12, 2017 10:30 pm
by raidho36
Well yeah - LÖVE threads are not real threads, because Lua doesn't support threads. They sort of are threads, but you need to keep in mind that they're implemented via separate Lua states running in separate threads. You can't pass a table (or anything really) from one Lua state to another, you can only do a full duplicate (so it won't be the same object, just a snapshot clone of it), which isn't even always possible.