Raycasts on StaticTriangleGroups
Posted: Fri Jan 09, 2009 9:33 pm
- Calling PhysicsSpace.rayCast() will return a list of entities that have been intersected by the ray.
- An intersection with a StaticTriangleGroup will create a null entry in the entity list.
- Since the entry is null, we have no data about the entity that was intersected, which makes it difficult to do a look-up.
My question: If a scene has many StaticTriangleGroups in it, what is the best way to determine WHICH StaticTriangleGroup has been intersected?
One (ugly) solution would be to perform a raycast on each of the StaticTriangleGroups in the scene, and see which one returns true... However, this won't really work if a single ray intersects multiple StaticTriangleGroups, as we will be left with multiple possibilities.
Any ideas? Thanks.
- An intersection with a StaticTriangleGroup will create a null entry in the entity list.
- Since the entry is null, we have no data about the entity that was intersected, which makes it difficult to do a look-up.
My question: If a scene has many StaticTriangleGroups in it, what is the best way to determine WHICH StaticTriangleGroup has been intersected?
One (ugly) solution would be to perform a raycast on each of the StaticTriangleGroups in the scene, and see which one returns true... However, this won't really work if a single ray intersects multiple StaticTriangleGroups, as we will be left with multiple possibilities.
Any ideas? Thanks.