- Home /
Returning list of Triangles, Vertices or Points by raycasting through a mesh (iPhone)
I've got a detailed mesh of a car with a transparency texture to give the affect of 'windows'.
To keep the car looking solid (so you can't see through the doors when looking in the window) I've made sure that the inside of the car is also modeled.
This means there the vertices are doubled sided in some parts of the mesh.
What I'm trying to achieve is to select all vertices, points or triangles (either one, doesn't matter) when using RayCastAll.
When I raycastall through the mesh it only returns the first hit. I've checked the upperbound of the Vector3 array but it only contains 1 element and I've Debug.DrawRay the ray that I'm using and it does pass right through.
Has anyone else experienced this?
Answer by Jaap Kreijkamp · Jan 12, 2010 at 03:46 AM
Although the documentation isn't really clear on this, RaycastAll returns hits of all colliders hit, but per collider only 1 hit. So it doesn't give you all hits for one collider, just the nearest one.
Thank you very much. I'll have to Raycast multiple rays then.
Hi $$anonymous$$, were you able to solve problem? I am trying to work on a program where I need to cast 1000 rays in circular pattern from a certain point to the distance of 50 metres. Then I need to get the hit distance from each ray and store it in an array.
You think it can be done? Any help is appreciated.