Box2D Forums

It is currently Sun Sep 21, 2014 9:05 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Time until collision
PostPosted: Fri Feb 17, 2012 8:21 am 
Offline

Joined: Wed Feb 15, 2012 11:22 am
Posts: 1
I have only one circle, and one square. They are both dynamic bodies, affected by gravity. I would like to calculate how much time there is until they collide. Actually I would like to call a function when there is exactly 1 sec before the collision. Do you know a way to achieve this with Box2D without making the calculations myself? I have seen something similar called "Time of Impact", but haven't found any examples online for it.


Top
 Profile  
 
 Post subject: Re: Time until collision
PostPosted: Fri Feb 24, 2012 4:27 pm 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2946
Yeah, you can use b2TimeOfImpact. You'll have to look at some of the examples in the testbed because it is an internal function and it is not documented in the manual.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group