xyzdist expression function

Returns the distance between a 3D coordinate and a primitive.

All Usage Examples

See also: primdist, nearpoint, pointdist

Usage

xyzdist(x, y, z, surface_node, prim_num, return_type)

If the prim_num is -1, finds the closest distance to any primitive in the surface node.

Examples

xyzdist(1, 2, 3, "/obj/geo1/grid1", 0, 0)

Returns the distance between (1, 2, 3) 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.