'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SoRayPickAction(3IV) .SH NAME SoRayPickAction \(em intersects objects with a ray cast into scene .SH INHERITS FROM SoAction > SoPickAction > SoRayPickAction .SH SYNOPSIS .ps -1 \*(Cr#include .sp .in 1i \f1Methods from class SoRayPickAction: .in 0.5i .sp .ta 27m .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Cr .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoRayPickAction\*(Cr(const SbViewportRegion &viewportRegion) .br .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetPoint\*(Cr(const SbVec2s &viewportPoint) .br .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetNormalizedPoint\*(Cr(const SbVec2f &normPoint) .br .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetRadius\*(Cr(float radiusInPixels) .br .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetRay\*(Cr(const SbVec3f &start, const SbVec3f &direction, float nearDistance = -1.0, float farDistance = -1.0) .br .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetPickAll\*(Cr(SbBool flag) .br .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisPickAll\*(Cr() const .br .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Crconst SoPickedPointList & .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetPickedPointList\*(Cr() const .br .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(CrSoPickedPoint * .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetPickedPoint\*(Cr(int index = 0) const .sp .in 1i \f1Methods from class SoPickAction: .in 0.5i .sp .ta 26m .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetViewportRegion\*(Cr(const SbViewportRegion &newRegion) .br .in 1i+26n .ti 0.5i .ta 26m .ds Pt \*(Crconst SbViewportRegion & .ie \w'\*(Pt'>=26n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetViewportRegion\*(Cr() const .sp .in 1i \f1Methods from class SoAction: .in 0.5i .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbapply\*(Cr(SoNode *node) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbapply\*(Cr(SoPath *path) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cbapply\*(Cr(const SoPathList &pathList, SbBool obeysRules = FALSE) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetClassTypeId\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual SoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetTypeId\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual SbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisOfType\*(Cr(SoType type) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbinvalidateState\*(Cr() .sp .SH DESCRIPTION This class performs picking by casting a ray into a scene and performing intersection tests with each object. The ray is extended to be a cone or cylinder, depending on the camera type, for intersection \&with points and lines. Each intersection is returned as an \*(CbSoPickedPoint\f1 instance. .sp The picking ray can be specified as either a ray from the camera location through a particular viewport pixel, or as a world-space \&ray. In the former case, a valid camera must be encountered during traversal of the graph to determine the location of the ray in world space. .sp Callers can cause the action to compute all intersections \&along the ray (sorted closest to farthest) by setting the \*(CbpickAll\f1 flag to TRUE. By default, the action computes only the closest intersection. In either case, the intersections are returned in an \*(CbSoPickedPointList\f1. Each intersection \&can be examined by accessing the appropriate \*(CbSoPickedPoint\f1 in the list. The \*(CbSoPickedPoint\f1 class provides methods to get the intersection point, normal, and other info. .SH METHODS .ta 27m .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Cr .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoRayPickAction\*(Cr(const SbViewportRegion &viewportRegion) .br .in 1i \f1Constructor takes viewport region to use for picking. Even though the picking operation may not involve a window per se, some nodes need this information to determine their size and placement. .sp .in 0.5i .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetPoint\*(Cr(const SbVec2s &viewportPoint) .br .in 1i \f1Sets the viewport-space point through which the ray passes, starting at the camera's viewpoint. Viewport coordinates range from (0,0) at the lower left to (width-1,height-1) at the upper right. .sp .in 0.5i .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetNormalizedPoint\*(Cr(const SbVec2f &normPoint) .br .in 1i \f1Sets the viewport point in normalized coordinates, which range from (0,0) at the lower left to (1,1) at the upper right. .sp .in 0.5i .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetRadius\*(Cr(float radiusInPixels) .br .in 1i \f1Set the radius (in pixels) around the point. This is used when testing the ray against lines and points. By default, the radius is 5 pixels. For perspective cameras, the ray is extended to be a cone when \&testing against lines and points. For orthographic cameras, the ray is extended to be a cylinder. The radius has no effect for shapes of other types. .sp .in 0.5i .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetRay\*(Cr(const SbVec3f &start, const SbVec3f &direction, float nearDistance = -1.0, float farDistance = -1.0) .br .in 1i \f1Sets a world-space ray along which to pick. The ray is defined as a world space starting point and direction vector. The direction vector will be normalized automatically. The last two arguments are the \¶metric distances between which intersections along the ray must occur. The distances are measured as if the direction vector is unit length; e.g., if \*(CrnearDistance\f1 is 2.0, the intersection must occur past (\*(Crstart\f1 + 2*(length \&of the direction vector)) units along the ray. These distances can be used to achieve near and far plane clipping. A negative distance (such as the default values) means disable clipping to that plane. .sp .in 0.5i .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetPickAll\*(Cr(SbBool flag) .br .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisPickAll\*(Cr() const .br .in 1i \f1Sets/returns whether the action will return all objects intersected or just the closest one. .sp .in 0.5i .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(Crconst SoPickedPointList & .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetPickedPointList\*(Cr() const .br .in 1i \f1Returns list of picked points. .sp .in 0.5i .in 1i+27n .ti 0.5i .ta 27m .ds Pt \*(CrSoPickedPoint * .ie \w'\*(Pt'>=27n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetPickedPoint\*(Cr(int index = 0) const .br .in 1i \f1Returns the indexed picked point from the list. .sp .in 0.5i .SH SEE ALSO \*(CbSoPickedPoint, SoPickedPointList