- Home /
Time when 2 objects will touch
Hi, I have 2 balls which rolls in different directions (something like billiard). I need to predict if the balls will touch and if they will I need to know when (in seconds). I know: - initial position of each ball VECTOR3 - velocity of each ball VECTOR3 - radius of each ball FLOAT
Any ideas? :) Thanks
Answer by koray1396 · Jul 21, 2014 at 10:02 AM
You may try this to find intersection of two lines.
http://www.wyrmtale.com/blog/2013/115/2d-line-intersection-in-c
This is in Vector2 by the way, Vector3 will be much complicated. THen you can find time by t = x / v
Hope this helps.
I was trying this before, but its not what I need. Because even if their ways will cross, one ball can be slower and they will not touch. Or they can go both in one line and if the second one will be faster, they will touch.
Your answer
Follow this Question
Related Questions
Quadrocopter flight 2 Answers
How to detect collision position and velocity? 2 Answers
how to I zero out a parented child's position in X,Y,Z on collision? 1 Answer
2D Movement [HELP!] 0 Answers
Get Interpolated rigidbody velocity 1 Answer