Page 2 of 3

Re: Collision and destroy problems

Posted: Fri Nov 07, 2008 4:02 am
by rude
I don't really use any IM clients, but if you have GMail, we can use the built-in chat system ... (andruud at gmail dot com)

I might go to sleep now, though. 5am local time, ffs. >_<

Re: Collision and destroy problems

Posted: Fri Nov 07, 2008 4:56 am
by Nexion
Posting the erroring files for rude

Re: Collision and destroy problems

Posted: Fri Nov 07, 2008 6:27 am
by rude
(This has now been fixed. Nexion overlooked a small but significant detail, the exact nature of which need not be revealed. :D)

Re: Collision and destroy problems

Posted: Fri Nov 07, 2008 3:00 pm
by Nexion
Hey! Just because I didn't realize that I installed 0.5.0 to the computer I was working on and not my flash drive does not mean that I was wrong.

Oh wait... yes it does...

And yes, rude, you DO have Scarlet Johanson on your bed

Re: Collision and destroy problems

Posted: Fri Nov 07, 2008 4:48 pm
by rude
I do? Awesome.

Re: Collision and destroy problems

Posted: Fri Nov 07, 2008 4:55 pm
by Kaze
rude wrote:Ah, I just noticed that myself! :D

Silly me, I should have paid more attention to your code. On the plus side, all this love.physics-investigating has been been very useful. I found at least one weakness I didn't consider.

This code will create a cyclic dependency, and the shape/body can never be garbage collected.

Code: Select all

local b = love.physics.newBody()
local s = love.physics.newShape(b)
local t = { b = b, s = s }
s:setData(t)
I suppose weak tables or something would be a solution to this.
You could call t.s:setData("") to remove, in that case (in the collision callback).

Re: Collision and destroy problems

Posted: Fri Nov 07, 2008 5:10 pm
by rude
You're absolutely right.

Code: Select all

-- But you meant to set it to nil, I assume.
t.s:setData(nil)

Re: Collision and destroy problems

Posted: Fri Nov 07, 2008 5:31 pm
by Kaze
rude wrote:You're absolutely right.

Code: Select all

-- But you meant to set it to nil, I assume.
t.s:setData(nil)
Wasn't sure if it accepted nil, but yeah.

Re: Collision and destroy problems

Posted: Wed Nov 12, 2008 3:36 am
by Lord Tim
I'm not sure if this was related to destroy() not working, but getCollideConnected() and setCollideConnected(collide) for joints do not seem to be working at all. Saying it's a nil value.

Re: Collision and destroy problems

Posted: Wed Nov 12, 2008 9:42 am
by rude
First of all: destroy() works. Ok? Ok. :D

I haven't tested those functions (lately), but I checked the SWIG interface just now, and the functions are listed (which means that they shouldn't cause a nil-value error, although they may still not work as expected, of course). I'll try to do an actual test later today.