Open Inventor Reference
|
Represents point on surface of picked object. More...
#include <Inventor/SoPickedPoint.h>
Public Member Functions | |
SoPickedPoint (const SoPickedPoint &pp) | |
Copy constructor. | |
~SoPickedPoint () | |
Destructor. | |
SoPickedPoint * | copy () const |
Returns an instance that is a copy of this instance. | |
const SbVec3f & | getPoint () const |
These return the intersection point and surface normal in world space, and the texture coordinates in image space. | |
const SbVec3f & | getNormal () const |
These return the intersection point and surface normal in world space, and the texture coordinates in image space. | |
const SbVec4f & | getTextureCoords () 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. | |
SoPath * | getPath () 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 SoDetail * | getDetail (const SoNode *node=NULL) const |
The following methods all take a pointer to a node in the returned path. | |
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. | |
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 |
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.
Definition at line 89 of file SoPickedPoint.h.
SoPickedPoint::SoPickedPoint | ( | const SoPickedPoint & | pp | ) |
SoPickedPoint::~SoPickedPoint | ( | ) |
SoPickedPoint::SoPickedPoint | ( | const SoPath * | path, |
SoState * | state, | ||
const SbVec3f & | objSpacePoint | ||
) |
SoPickedPoint* SoPickedPoint::copy | ( | ) | const |
The caller is responsible for deleting the copy when done.
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.
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.
const SbVec3f& SoPickedPoint::getNormal | ( | ) | const [inline] |
Definition at line 108 of file SoPickedPoint.h.
SoPath* SoPickedPoint::getPath | ( | ) | const [inline] |
Definition at line 120 of file SoPickedPoint.h.
const SbVec3f& SoPickedPoint::getPoint | ( | ) | const [inline] |
Definition at line 105 of file SoPickedPoint.h.
const SbVec4f& SoPickedPoint::getTextureCoords | ( | ) | const [inline] |
Definition at line 111 of file SoPickedPoint.h.
SbBool SoPickedPoint::isOnGeometry | ( | ) | const [inline] |
The pick style (see SoPickStyle) affects this decision.
Definition at line 125 of file SoPickedPoint.h.
NULL may be passed to remove a detail. All detail pointers are NULL by default.
void SoPickedPoint::setMaterialIndex | ( | int | index | ) | [inline] |
Definition at line 172 of file SoPickedPoint.h.
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
void SoPickedPoint::setObjectTextureCoords | ( | const SbVec4f & | texCoords | ) |