Open Inventor Reference
SoPickedPoint Class Reference

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

#include <Inventor/SoPickedPoint.h>

Public Member Functions

 SoPickedPoint (const SoPickedPoint &pp)
 Copy constructor.
 
 ~SoPickedPoint ()
 Destructor.
 
SoPickedPointcopy () const
 Returns an instance that is a copy of this instance.
 
const SbVec3fgetPoint () const
 These return the intersection point and surface normal in world space, and the texture coordinates in image space.
 
const SbVec3fgetNormal () const
 These return the intersection point and surface normal in world space, and the texture coordinates in image space.
 
const SbVec4fgetTextureCoords () const
 These return the intersection point and surface normal in world space, and 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.
 
bool 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
 The following methods all take a pointer to a node in the returned path.
 

Transformations

These return the transformation matrices between world space and the object space corresponding to the given node in the path.

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

SbMatrix getObjectToWorld (const SoNode *node=NULL) const
 
SbMatrix getWorldToObject (const SoNode *node=NULL) const
 
SbMatrix getObjectToImage (const SoNode *node=NULL) const
 
SbMatrix getImageToObject (const SoNode *node=NULL) const
 
SbVec3f getObjectPoint (const SoNode *node=NULL) const
 
SbVec3f getObjectNormal (const SoNode *node=NULL) const
 
SbVec4f getObjectTextureCoords (const SoNode *node=NULL) const
 
void setObjectNormal (const SbVec3f &normal)
 NOTE: these methods should be called ONLY by the node that causes the SoPickedPoint instance to be created, and ONLY at the time it is created.
 
void setObjectTextureCoords (const SbVec4f &texCoords)
 Sets the texture coordinates in object space.
 
void setMaterialIndex (int index)
 Sets the material index.
 
void setDetail (SoDetail *detail, SoNode *node)
 Sets the detail corresponding to the given node in the path.
 
 SoPickedPoint (const SoPath *path, SoState *state, const SbVec3f &objSpacePoint)
 Copy constructor.
 

Detailed Description

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.

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

See Also
SoRayPickAction, SoPickStyle, SoDetail, SoPath

Definition at line 89 of file SoPickedPoint.h.

Constructor & Destructor Documentation

◆ SoPickedPoint() [1/2]

SoPickedPoint::SoPickedPoint ( const SoPickedPoint pp)

◆ ~SoPickedPoint()

SoPickedPoint::~SoPickedPoint ( )

◆ SoPickedPoint() [2/2]

SoPickedPoint::SoPickedPoint ( const SoPath path,
SoState state,
const SbVec3f objSpacePoint 
)

Member Function Documentation

◆ copy()

SoPickedPoint * SoPickedPoint::copy ( ) const

The caller is responsible for deleting the copy when done.

◆ getDetail()

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

If the node pointer is NULL (the default), the information corresponding to the tail of the path is returned. Returns the detail that corresponds to the given node in the path returned by getPath(). If the node pointer is NULL (the default), the detail corresponding to the tail of the (full) path is returned.

◆ getImageToObject()

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

◆ getMaterialIndex()

int SoPickedPoint::getMaterialIndex ( ) const
inline

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

Definition at line 117 of file SoPickedPoint.h.

◆ getNormal()

const SbVec3f & SoPickedPoint::getNormal ( ) const
inline

Definition at line 108 of file SoPickedPoint.h.

◆ getObjectNormal()

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

◆ getObjectPoint()

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

◆ getObjectTextureCoords()

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

◆ getObjectToImage()

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

◆ getObjectToWorld()

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

◆ getPath()

SoPath * SoPickedPoint::getPath ( ) const
inline

Definition at line 120 of file SoPickedPoint.h.

◆ getPoint()

const SbVec3f & SoPickedPoint::getPoint ( ) const
inline

Definition at line 105 of file SoPickedPoint.h.

◆ getTextureCoords()

const SbVec4f & SoPickedPoint::getTextureCoords ( ) const
inline

Definition at line 111 of file SoPickedPoint.h.

◆ getWorldToObject()

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

◆ isOnGeometry()

bool SoPickedPoint::isOnGeometry ( ) const
inline

The pick style (see SoPickStyle) affects this decision.

Definition at line 125 of file SoPickedPoint.h.

◆ setDetail()

void SoPickedPoint::setDetail ( SoDetail detail,
SoNode node 
)

NULL may be passed to remove a detail. All detail pointers are NULL by default.

◆ setMaterialIndex()

void SoPickedPoint::setMaterialIndex ( int  index)
inline

Definition at line 172 of file SoPickedPoint.h.

◆ setObjectNormal()

void SoPickedPoint::setObjectNormal ( const SbVec3f normal)

Setting or changing the normal or texture coordinates at a later time may cause undefined results. Sets the normal in object space

◆ setObjectTextureCoords()

void SoPickedPoint::setObjectTextureCoords ( const SbVec4f texCoords)

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