Skip to content

Ensure vtkHardwarePicker returns the ID from the closest node

Paul Harris requested to merge paulharris/vtk:fix-vtkHardwarePicker-paths into master

Previously HardwarePicker would take the path returned by vtkRenderer::PickPropFrom, which returns the closest picked node (lowest z buffer value). PickPropFrom also returns a vtkSelection with a list of all picked nodes.

HardwarePicker would then extract the composite index and PointId/CellId from the first vtkSelectionNode in the returned selection, which is not guaranteed to be the closest picked node, resulting in incorrect ids being used. Further, this id would be used in ComputeIntersectionFromDataSet to compute the pick position and pick normal.

This is fixed by making vtkHardwarePicker search the selection nodes itself to identify the closest picked node, ensuring that the picked prop and ids are extracted from the same node.

Kudos to @mheinsen

Merge request reports