# vector collision on polygon in 3d space detection/testing?

In the 3d fps in java I'm working on, I need a bullet to be fired and to tell if it hit someone. All visual objects in the game are defined through OpenGL, so the object it can be colliding with can be any drawable polygon (although they will most likely be triangles and rectangles anyways). The bullet is not an object, but will be treated as a vector that instantaneously moves all the way across the map (like the snipper riffle in Halo). What's the best way to detect/test collisions with the polygon and the vector. I have access to OpenCL, however I have absolutely no experience with it. I am very early in the developmental stage, so if you think there's a better way of going about this, feel free to tell me (I barley have a player model to collide with anyways, so I'm flexible with it).

Thanks

• -1 There are tons of material about it in the net, didn't do research. – Maik Semder Jul 1 '11 at 6:22
• keywords to search for starters "ray triangle intersection" – Maik Semder Jul 1 '11 at 10:00
• agreed; -1 also. – TravisG Jul 1 '11 at 14:34
• Also check out bounding spheres and ray - bounding sphere intersection. – Roy T. Jul 1 '11 at 15:44

Assuming you are there, and that you implement a method for shape that is: double GetIntersectionT(Ray r) - Returns -1.0 if the intersection test fails.