Jump to content
  • Advertisement
Sign in to follow this  
Kurt-olsson

sphere line time of collision

This topic is 2127 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!