Enhancing collision callbacks.

Discuss new features and future development.

Would you like this functionality:

Sooner! I have awesome uses for this.
5
100%
Later. Please don't break my code that relies on trunk!
0
No votes
 
Total votes: 5

dieterweb
Posts: 176
Joined: Fri Feb 27, 2009 7:12 am
Location: Germany
Contact:

Re: Enhancing collision callbacks.

Post by dieterweb »

ok, got you.

That's great. I have really some use for the collide callback.

Thomas
Visit our game Blog: [url]http://zombiesmash.gamedrs.com[/url] or follow us on twitter: [url]http://twitter.com/zombiesmash[/url]
maximile
Posts: 157
Joined: Mon Aug 20, 2007 12:53 pm
Location: London, UK
Contact:

Re: Enhancing collision callbacks.

Post by maximile »

Thanks Scott. It's great when new features are added to play with!
dieterweb
Posts: 176
Joined: Fri Feb 27, 2009 7:12 am
Location: Germany
Contact:

Re: Enhancing collision callbacks.

Post by dieterweb »

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
Visit our game Blog: [url]http://zombiesmash.gamedrs.com[/url] or follow us on twitter: [url]http://twitter.com/zombiesmash[/url]
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Enhancing collision callbacks.

Post by slembcke »

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
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.

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/
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests