Environment.FindClosestVertex (Point, Double, Point3D) Method
Parameters
- mousePos
- Point
Mouse position (zero on top)
- maxDistance
- double
Limit the search to points at this distance in pixels from mouse cursor position
- closest
- Point3D
The closest vertex as a 3D point
Return Value
intThe entity index if the closest vertex is nearer than maxDistance, -1 otherwise.
The closest point is in the coordinate space of the EntityList.CurrentBlockReference so, if there is a current BlockReference, to get the 3D world coordinates
of the closest point you need to transform it by the EntityList.CurrentTransformation.