Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

sphere line time of collision

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 KurtO   Members   

254
Like
0Likes
Like

Posted 24 August 2012 - 05:47 AM

Hi!

I need a algortihm for impact time t from sphere origin to destination. I have had this algorithm once but i can´t find it anywhere and i have search google. for hours.

I need a formula that can give me time of impact from a sphere with a velocity moving pass a line.

i need this so my sphere don´t go pass my walls if going to fast.

any help is apprichiated.

#2 The_Neverending_Loop   Members   

635
Like
0Likes
Like

Posted 24 August 2012 - 11:46 AM

Check this link out.

http://wiki.cgsociety.org/index.php/Ray_Sphere_Intersection

Treat your line and a ray, if there is collision then check the boundary conditions of your line to make sure it actually collided. Once you get the distance between the two, you just divide by the velocity the sphere is traveling and you should have you'r time. Hope this helps.

#3 KurtO   Members   

254
Like
0Likes
Like

Posted 24 August 2012 - 02:27 PM

That my friend! Is exactly what i needed! Many thanks!




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.