ok, got you.
That's great. I have really some use for the collide callback.
Thomas
Enhancing collision callbacks.
-
- Posts: 176
- Joined: Fri Feb 27, 2009 7:12 am
- Location: Germany
- Contact:
Re: Enhancing collision callbacks.
Visit our game Blog: [url]http://zombiesmash.gamedrs.com[/url] or follow us on twitter: [url]http://twitter.com/zombiesmash[/url]
-
- Posts: 157
- Joined: Mon Aug 20, 2007 12:53 pm
- Location: London, UK
- Contact:
Re: Enhancing collision callbacks.
Thanks Scott. It's great when new features are added to play with!
-
- Posts: 176
- Joined: Fri Feb 27, 2009 7:12 am
- Location: Germany
- Contact:
Re: Enhancing collision callbacks.
Can I get the info if a collision is the first (i.e. the one which invoked the collide callback) directly in the postSolve callback? Or do I have to flag those somehow myself in the collide callback?
Thomas
Thomas
Visit our game Blog: [url]http://zombiesmash.gamedrs.com[/url] or follow us on twitter: [url]http://twitter.com/zombiesmash[/url]
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: Enhancing collision callbacks.
Yup, I thought of that too. Originally I wasn't going to make a separate callback for begin and preSolve, but decided it would be nicer with two instead of always putting in an if-else.dieterweb wrote:Can I get the info if a collision is the first (i.e. the one which invoked the collide callback) directly in the postSolve callback? Or do I have to flag those somehow myself in the collide callback?
Thomas
The following function returns true if this is the first step that the shapes were touching. I use it in the new player control demo to re-enable player friction the step after a collision starts so that the high impact forces don't also generate high friction forces.
Code: Select all
cpArbiterIsFirstContact(cpArbiter *arb)
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/
Who is online
Users browsing this forum: No registered users and 1 guest