pointdist
expression function
Returns the distance between a point and a primitive.
See also: primdist, xyzdist, nearpoint
Usage
pointdist(surface_node, point_num, surface_node, prim_num, return_type)
Given a point and a primitive, this function finds the distance between the point and the closest spot on the primitive. If prim_num is minus one, the closest distance to any primitive is found.
-
return_type = 0 returns the minimum distance.
-
return_type = 1 returns the u parametric value at the point of minimum distance.
-
return_type = 2 returns the v parametric value at the point of minimum distance.
-
return_type = 3 returns the primitive number that was closest. Enter -1 as the prim_num.
Examples
pointdist("/obj/geo1/add1", 0, "/obj/geo1/grid1", 0, 0)
Returns the distance between point 0 of add1 and the closest spot from the surface of grid1 primitive number 0. If the return_type were 1, the u parametric value that is closest to the point would be returned.