Sends a ray from the position P along the direction D.
float rayhittest(vector P, vector D, float bias)
float rayhittest(vector P, vector D, vector pHit&, vector nHit&, float bias)
Sends a ray from the position P along the direction D. The length of the D vector represents the farthest distance considered when check for occlusion.
Returns the distance to the object intersected. If no object is hit, returns less than 0.
If you specify pHit and nHit, they get the position and normal of the hit surface.
In many cases, the area sampling features will not produce usable results with the rayhittest() function.
When hit testing polygons you can get lots of rays missing. In these cases triangulating the geometry can improves hits.