A SERVICE OF

logo

Selecting Screen Objects
141
Figure 12-1 Ray Pick Action
The shape closest to the origin of the csSeg and intersected by the line segment is
recorded in a csHit object. For information about csHit, see Storing Selected Screen
Objects on page 142.
Using Pick()
csCamera::pick() uses window and viewport coordinates to select the screen object
closest to the ray connecting the camera to the point. You might supply the window
coordinates using the user input methods; see Handling User Input on page 139.
When you supply pick() with window coordinates, the method internally uses
csContext::getViewport() to convert the coordinates to viewpoint coordinates. The
method then calls csIsectAction to construct a ray from the camera to the coordinates.
The screen object closest the camera on the ray is recorded in a csHit object. For
information about csHit, see Storing Selected Screen Objects on page 142.
For information about csContext::getViewport(), see Setting the Screen Display of the
Scene on page 97.
S
csPickPoints