Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoPickedPoint Class Reference

Represents point on surface of picked object. More...

#include <Inventor/SoPickedPoint.h>

Public Member Functions

 SoPickedPoint ()
 Default constructor.
 
 SoPickedPoint (const SoPickedPoint &pp)
 Copy constructor.
 
 ~SoPickedPoint ()
 Destructor.
 
SoPickedPointcopy () const
 
const SbVec3fgetPoint () const
 Returns the intersection point in world space.
 
const SbVec3fgetNormal () const
 Returns the surface normal in world space.
 
const SbVec4fgetTextureCoords () const
 Returns the texture coordinates in image space.
 
int getMaterialIndex () const
 Returns the index into the current set of materials of the material active at the intersection point.
 
SoPathgetPath () const
 Returns the path to the object that was intersected.
 
SbBool isOnGeometry () const
 Returns whether the intersection is actually on the geometry of the character that was hit, as opposed to being on the bounding box.
 
const SoDetailgetDetail (const SoNode *node=NULL) const
 Returns the detail that corresponds to the specified node in the path returned by getPath().
 
SbMatrix getObjectToWorld (const SoNode *node=NULL) const
 Returns the transformation matrix between the object space and world space corresponding to the given node in the path.
 
SbMatrix getWorldToObject (const SoNode *node=NULL) const
 Returns the transformation matrix between world space and the object space corresponding to the given node in the path.
 
SbMatrix getObjectToImage (const SoNode *node=NULL) const
 Returns the texture transformation matrix between the object space and image space corresponding to the given node in the path.
 
SbMatrix getImageToObject (const SoNode *node=NULL) const
 Returns the texture transformation matrix between image space and the object space corresponding to the given node in the path.
 
SbVec3f getObjectPoint (const SoNode *node=NULL) const
 Returns the intersection point in the object space corresponding to the given node in the path.
 
SbVec3f getObjectNormal (const SoNode *node=NULL) const
 Returns the surface normal in the object space corresponding to the given node in the path.
 
SbVec4f getObjectTextureCoords (const SoNode *node=NULL) const
 Returns the texture coordinates in the object space corresponding to the given node in the path.
 

Detailed Description

Represents point on surface of picked object.

An SoPickedPoint represents a point on the surface of an object that was picked by applying an SoRayPickAction to a scene. It contains a path to the picked shape, the point of intersection, the surface normal and texture coordinates at that point, and other information. Note that it is not always necessary to explicitly apply an SoRayPickAction to the scene. The getPickedPoint method may also be called on an SoHandleEventAction or an SoEventCallback node.

Each node in the picked path may have a corresponding instance of an SoDetail subclass. These detail instances are stored in the SoPickedPoint.

SEE ALSO

SoRayPickAction, SoPickStyle, SoDetail, SoPath, SoEventCallback

Definition at line 103 of file SoPickedPoint.h.

Constructor & Destructor Documentation

◆ SoPickedPoint() [1/2]

SoPickedPoint::SoPickedPoint ( )

Default constructor.

◆ SoPickedPoint() [2/2]

SoPickedPoint::SoPickedPoint ( const SoPickedPoint pp)

Copy constructor.

◆ ~SoPickedPoint()

SoPickedPoint::~SoPickedPoint ( )

Destructor.

Member Function Documentation

◆ copy()

SoPickedPoint * SoPickedPoint::copy ( ) const

◆ getDetail()

const SoDetail * SoPickedPoint::getDetail ( const SoNode node = NULL) const

Returns the detail that corresponds to the specified node in the path returned by getPath().

If the node is null, the detail corresponding to the tail of the pick path is returned.

Caution: If there is no detail class associated with the node, null is returned.

◆ getImageToObject()

SbMatrix SoPickedPoint::getImageToObject ( const SoNode node = NULL) const

Returns the texture transformation matrix between image space and the object space corresponding to the given node in the path.

If the node is NULL, the matrix corresponding to the tail of the (full) path is returned. By default, the node is NULL.

◆ getMaterialIndex()

int SoPickedPoint::getMaterialIndex ( ) const
inline

Returns the index into the current set of materials of the material active at the intersection point.

Note that if the materials are interpolated between vertices, the index will correspond to the material at one of the vertices.

Definition at line 152 of file SoPickedPoint.h.

◆ getNormal()

const SbVec3f & SoPickedPoint::getNormal ( ) const
inline

Returns the surface normal in world space.

NOTE: It is possible to disable computation of normal vectors by calling the enableNormalsGeneration() method on SoRayPickAction. If normal vectors are disabled, this method returns 0,0,0.

Definition at line 136 of file SoPickedPoint.h.

◆ getObjectNormal()

SbVec3f SoPickedPoint::getObjectNormal ( const SoNode node = NULL) const

Returns the surface normal in the object space corresponding to the given node in the path.

If the node is NULL, the information corresponding to the tail of the (full) path is returned. By default, the node is NULL.

◆ getObjectPoint()

SbVec3f SoPickedPoint::getObjectPoint ( const SoNode node = NULL) const

Returns the intersection point in the object space corresponding to the given node in the path.

If the node is NULL, the information corresponding to the tail of the (full) path is returned. By default, the node is NULL.

◆ getObjectTextureCoords()

SbVec4f SoPickedPoint::getObjectTextureCoords ( const SoNode node = NULL) const

Returns the texture coordinates in the object space corresponding to the given node in the path.

If the node is NULL, the information corresponding to the tail of the (full) path is returned. By default, the node is NULL.

◆ getObjectToImage()

SbMatrix SoPickedPoint::getObjectToImage ( const SoNode node = NULL) const

Returns the texture transformation matrix between the object space and image space corresponding to the given node in the path.

If the node is NULL, the matrix corresponding to the tail of the (full) path is returned. By default, the node is NULL.

◆ getObjectToWorld()

SbMatrix SoPickedPoint::getObjectToWorld ( const SoNode node = NULL) const

Returns the transformation matrix between the object space and world space corresponding to the given node in the path.

If the node is NULL, the matrix corresponding to the tail of the (full) path is returned. By default, the node is NULL.

◆ getPath()

SoPath * SoPickedPoint::getPath ( ) const
inline

Returns the path to the object that was intersected.

Definition at line 157 of file SoPickedPoint.h.

◆ getPoint()

const SbVec3f & SoPickedPoint::getPoint ( ) const
inline

Returns the intersection point in world space.

Definition at line 128 of file SoPickedPoint.h.

◆ getTextureCoords()

const SbVec4f & SoPickedPoint::getTextureCoords ( ) const
inline

Returns the texture coordinates in image space.

NOTE: By default the SoRayPickAction does not compute texture coordinates and this method returns 0,0,0,0. To enable texture coordinate computation call the enableTexCoordsGeneration() method on the pick action object or set the environment variable OIV_PICK_GENERATE_ALL_PROPERTIES to true.

Definition at line 145 of file SoPickedPoint.h.

◆ getWorldToObject()

SbMatrix SoPickedPoint::getWorldToObject ( const SoNode node = NULL) const

Returns the transformation matrix between world space and the object space corresponding to the given node in the path.

If the node is NULL, the matrix corresponding to the tail of the (full) path is returned. By default, the node is NULL.

◆ isOnGeometry()

SbBool SoPickedPoint::isOnGeometry ( ) const
inline

Returns whether the intersection is actually on the geometry of the character that was hit, as opposed to being on the bounding box.

The pick style (see SoPickStyle) affects this decision.

Definition at line 164 of file SoPickedPoint.h.


The documentation for this class was generated from the following file: