predict the path of a shape considering bounces

Official forum for the Chipmunk2D Physics Library.
Post Reply
sillipo
Posts: 5
Joined: Thu Jun 30, 2011 1:22 pm
Contact:

predict the path of a shape considering bounces

Post by sillipo »

Hi all,
I have done what suggested in this post
http://www.slembcke.net/forums/viewtopi ... e59c25d639
to predict the path of a body without taking into account collisions.

Now I would like to predict the path by also considering bounces. Is there any way to do that?

Thank you in advance

Andrea
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: predict the path of a shape considering bounces

Post by slembcke »

Not in general without copying the entire space then stepping the entire thing forward through time. This would be ridiculously expensive.

If you just want to get the path of a bullet bouncing off of static geometry you can represent the bullet using short raycasts and calculate simple elastic collisions from the collision normals. This would be about as expensive as using shape queries.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
sillipo
Posts: 5
Joined: Thu Jun 30, 2011 1:22 pm
Contact:

Re: predict the path of a shape considering bounces

Post by sillipo »

suppose I just would like to take into account bounces against a specific object would it be more feasible? how should I do that? creating another space with the two objects and pushing it forward? is there an easier way?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: predict the path of a shape considering bounces

Post by slembcke »

That would work, but it sounds pretty complicated to get it right. There isn't really a simpler way to do it.
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 29 guests