Out of curiosity, how are you calculating damage in the separate callback? Just subtracting a constant? I ask because the impulse and kinetic energy functions for cpArbiter only accidentally work (sometimes) in separate() callbacks. Because the objects aren't colliding anymore when separate is called, the collision data is a frame old and may or may not have been cleaned up yet. I put an assertion for it in Chipmunk 6.1 to warn people about that.
Anyway, post-step() callbacks should work just fine from separate() callbacks (even ones triggered when removing objects), as well as other post-step() callbacks. If you still have an issue with Chipmunk from Git, I'd like to make sure it's not a bug.
<SOLVED>Collisions not coliding
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: <SOLVED>Collisions not coliding
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 89
- Joined: Thu Dec 15, 2011 9:18 am
- Contact:
Re: <SOLVED>Collisions not coliding
I am using the same basic structure you used in Angry Chipmunks.
Haven't tried the new code yet.
Haven't tried the new code yet.
Chipmunk Pro and cocos2D 2.x branch for iOS development
-
- Posts: 89
- Joined: Thu Dec 15, 2011 9:18 am
- Contact:
Re: <SOLVED>Collisions not coliding
I did incorporate the latest version of Objective Chipmunk into my project, and it did solve the postSolve issue. Previously, I had postSolve removing the object, and separate calculating damage. If I didn't remove the object, it wouldn't calculate damage. I consolidated them into one callback in postSolve now, and it works as expected.
Thanks!
Jim
Thanks!
Jim
Chipmunk Pro and cocos2D 2.x branch for iOS development
Who is online
Users browsing this forum: No registered users and 22 guests