465

Picking shapes
Using the mouse for a pick

  • Create a behavior that wakes up on mouse events

  • On a mouse release:
  • Construct a PickRay from the eye passing through the 2D mouse screen point

  • Initiate a pick to find all pick hits along the ray, sorted from closest to furthest

  • Get the first pick hit in the returned data

  • Do something to that picked shape

  • (Re)declare interest in mouse events