[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[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/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/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/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 - <SOLVED>Collisions not coliding

<SOLVED>Collisions not coliding

Official forum for the .

<SOLVED>Collisions not coliding

Postby jcmeyer5 » Thu May 10, 2012 2:53 pm

Last edited by jcmeyer5 on Fri May 11, 2012 7:03 am, edited 1 time in total.
Chipmunk Pro and cocos2D 2.x branch for iOS development
jcmeyer5
 
Posts: 89
Joined: Thu Dec 15, 2011 9:18 am

Re: Collisions... nothing happening

Postby slembcke » Thu May 10, 2012 3:52 pm

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: Collisions... nothing happening

Postby jcmeyer5 » Thu May 10, 2012 9:23 pm

Chipmunk Pro and cocos2D 2.x branch for iOS development
jcmeyer5
 
Posts: 89
Joined: Thu Dec 15, 2011 9:18 am

Re: Collisions... nothing happening

Postby jcmeyer5 » Thu May 10, 2012 10:39 pm

Eureka!! I found it. My "begin" callback needed to be a BOOL return and not a void return. Once I fixed that, I started getting impact values and the circles bounced off properly.
Chipmunk Pro and cocos2D 2.x branch for iOS development
jcmeyer5
 
Posts: 89
Joined: Thu Dec 15, 2011 9:18 am

Re: <SOLVED>Collisions not coliding

Postby jcmeyer5 » Fri May 11, 2012 7:04 am

I was able to migrate the collision code back to my original classes without incident. Sweetness!
Chipmunk Pro and cocos2D 2.x branch for iOS development
jcmeyer5
 
Posts: 89
Joined: Thu Dec 15, 2011 9:18 am

Re: <SOLVED>Collisions not coliding

Postby slembcke » Fri May 11, 2012 7:37 am

Also, cpArbiterTotalImpulse() (and other functions that deal with impact values) must be called from a post-solve callback. Otherwise the values you are asking for haven't been calculated 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: <SOLVED>Collisions not coliding

Postby jcmeyer5 » Fri May 11, 2012 9:56 am

Just figured that out too, as I was getting intermittent values. Moving it to the postSolve gives the results I am looking for. Thanks for the help. I am going to do a search to see if I can find more details on the differences in collision callbacks.
Chipmunk Pro and cocos2D 2.x branch for iOS development
jcmeyer5
 
Posts: 89
Joined: Thu Dec 15, 2011 9:18 am

Re: <SOLVED>Collisions not coliding

Postby jcmeyer5 » Fri May 11, 2012 1:43 pm

Chipmunk Pro and cocos2D 2.x branch for iOS development
jcmeyer5
 
Posts: 89
Joined: Thu Dec 15, 2011 9:18 am

Re: <SOLVED>Collisions not coliding

Postby slembcke » Fri May 11, 2012 10:21 pm

Aha! I think that is the same as a bug that I just fixed. It's... a little complicated to explain why it happens though. It has to do with separate callbacks that can be triggered immediately when removing objects, and scheduling post-step callbacks within them. Try updating to the latest code out of Git and see if your problem goes away.
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: <SOLVED>Collisions not coliding

Postby jcmeyer5 » Sat May 12, 2012 2:59 pm

I will try the code Monday. I did find a work around with switching the callbacks. I put rock removal as postSolve and damage as separate. Not sure if that switch has ramifications that I have not yet considered, but it appears to be working well.
Chipmunk Pro and cocos2D 2.x branch for iOS development
jcmeyer5
 
Posts: 89
Joined: Thu Dec 15, 2011 9:18 am

Next

Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 3 guests

cron