Original Post
I have a ball (mesh1) that it move between two circles (mesh2 and mesh3)
I do the test with
if ( mesh1.mesh.Intersect(vRayPosition, mesh1.direction, ref closestHit, ref closestHita) )
but never is true.
I''d drawed a line from the center of the ball pointing to the direction vector (-1,0,0 when go left and 1,0,0 when go right)
The line is drawed from the center of the ball as i expected (and change the direction when collide with a circle)
The move of the ball is a ping - pong.
I *see* the line moving with the ball, (vRayPosition are the ball & line position)
First i draw all the object, later i do the test.
Some questions..
1. I need to draw all the objects first ? (I think that it need to be *into* the world in order to do some intersect test)
2. When a ray start (ie) x=+500 and it go to the left (-1,0,0),, it stop in 0? (if it true and i have a mesh in x=-500 it never work)
3. I need to set up some other matrix before to do the test? (World Inverted, camera matrix,,)
4. Any aditional info?