x


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?

more ▼

asked Jan 12 '10 at 03:33 AM

David O'Donoghue gravatar image

David O'Donoghue
61 4 4 9

(comments are locked)
10|3000 characters needed characters left

1 answer: sort oldest

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.

more ▼

answered Jan 12 '10 at 03:46 AM

Jaap Kreijkamp gravatar image

Jaap Kreijkamp
6.4k 20 26 70

Thank you very much. I'll have to Raycast multiple rays then.

Jan 12 '10 at 04:46 AM David O'Donoghue
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1879
x1703
x1531
x1364

asked: Jan 12 '10 at 03:33 AM

Seen: 2243 times

Last Updated: Jan 12 '10 at 03:33 AM