RwPickClump(RwClump *clump, RwInt32 vpx, RwInt32 vpy, RwCamera *camera, RwPickRecord *pick);
Finds the frontmost polygon of the clump whose projection on the cameras viewport "contains" the specified point.
clump Pointer to the clump.
vpx X coordinate (in viewport space coordinates).
vpy Y coordinate (in viewport space coordinates).
camera Pointer to the camera.
pick Pointer to the pick record.
A pointer to the argument pick if successful, and NULL otherwise.
vpx and vpy must be in viewport rather than device space coordinates. To convert from a point in device space coordinates (such as the position of the mouse) to viewport space coordinates simply subtract the X and Y coordinates of the cameras viewport from the X and Y coordinates of the point.
The pick record has a type field that will have either the value rwNAPICKOBJECT or rwPICKCLUMP. The former means that the clump was not picked.
If the pick records type is rwPICKCLUMP, then assuming that pick is a pick record structure whose address was passed as the last argument of the function, upon return from the function:
is a pointer to the clump picked,
is a pointer to the polygon picked,
is an RwPickVertexData structure giving information about the picked vertex, and
is the world space coordinates of the actual point picked.
RwPickVertexData is defined as follows:
Fields vindex and d2 specify respectively the index of the vertex picked and the square of its distance (in viewport space units) from the actual pick position.