[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - Changes in sensor behavior in Chipmunk 6

Changes in sensor behavior in Chipmunk 6

Discuss any Chipmunk bugs here.

Changes in sensor behavior in Chipmunk 6

Postby TomorrowPlusX » Tue Jul 12, 2011 7:25 am

TomorrowPlusX
 
Posts: 28
Joined: Tue Jul 12, 2011 6:31 am

Re: Changes in sensor behavior in Chipmunk 6

Postby slembcke » Tue Jul 12, 2011 9:52 am

Hmm. Shoot. That's a bug.

I thought I had a unit test to catch that case, but I guess not.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Changes in sensor behavior in Chipmunk 6

Postby TomorrowPlusX » Tue Jul 12, 2011 10:21 am

Sorry to make work for you :)

But I'm glad it is a bug and not a feature, because I was working out how best to work around this and it wasn't looking pretty.
TomorrowPlusX
 
Posts: 28
Joined: Tue Jul 12, 2011 6:31 am

Re: Changes in sensor behavior in Chipmunk 6

Postby slembcke » Tue Jul 12, 2011 10:41 am

Heh, now I have to do it instead. ;)

Sensors and sleeping shapes are sort of a giant pain for callbacks because they don't keep the collision cache "warm" like regular collisions do. There are few lines of some annoying code because of it. Apparently I did some of it wrong. :-\
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Changes in sensor behavior in Chipmunk 6

Postby slembcke » Thu Jul 14, 2011 1:58 am

So I figured out what the problem is. Let me just say. Oh crap. :(
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Changes in sensor behavior in Chipmunk 6

Postby TomorrowPlusX » Thu Jul 14, 2011 6:38 am

Sorry to ruin your day. Is there anything I can do to help? I'm not familiar with Chipmunk's internals, but I'm a reasonably smart guy.
TomorrowPlusX
 
Posts: 28
Joined: Tue Jul 12, 2011 6:31 am

Re: Changes in sensor behavior in Chipmunk 6

Postby slembcke » Thu Jul 14, 2011 9:55 am

Well, the way that the separate callbacks happen is unfortunately very delicate and complicated. It's very tightly integrated (not really in a good way any more) with how Chipmunk caches collisions. Chipmunk tracks a number of flags and such in it's collision pairs (cpArbiter) when their state changes (active, cached, etc). There is also a number of edge cases that had to be tacked on such as calling the separate callbacks immediately when shapes are removed because if you waited until the next cpSpaceStep() call, the user might have already freed the shape pointer. Sensor shapes and rejected collisions on sleeping objects also have some annoying hacks to get around the fact that they don't keep their collisions "hot" in the cache.

The bug I made with Chipmunk 6 is that separate callbacks only get called on removal for collisions in the contact graph. The contact graph is mildly expensive to generate so I made it optional to enable it. -_-

To fix it, I'm going to have to redesign how some of the collision caching works. There will probably be some unavoidable performance ramifications for the add/remove functions. I'm not quite sure how to ask for help with that, and explaining how all the little bits of code here and there work sounds kind of hard. I do appreciate the offer though.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Changes in sensor behavior in Chipmunk 6

Postby TomorrowPlusX » Thu Jul 14, 2011 4:52 pm

Well, I guess I'm glad I helped find a bug? ;)
TomorrowPlusX
 
Posts: 28
Joined: Tue Jul 12, 2011 6:31 am

Re: Changes in sensor behavior in Chipmunk 6

Postby slembcke » Fri Jul 15, 2011 8:51 am

Ok, so I wrote a bunch more collision handler unit tests yesterday (they are part of Objective-Chipmunk). I think I fixed the issue, but am looking for a slightly less stupid way to implement it. I'm also writing more tests to try and check more of the edge cases to make sure I did it right this time. I haven't pushed the changes to the public repository yet.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Changes in sensor behavior in Chipmunk 6

Postby TomorrowPlusX » Fri Jul 15, 2011 2:31 pm

Wow! I will patiently wait. The good news is this has forced me to put pathfinding aside for a few days so I'm having a fun time writing tentacle-dynamics for my monster :D
TomorrowPlusX
 
Posts: 28
Joined: Tue Jul 12, 2011 6:31 am

Next

Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests