MIntersection Class Reference

#include <MSelectionContext.h>

Class Description

Public Member Functions

MSelectionContext::SelectionLevel selectionLevel (MStatus *ReturnStatus=NULL) const
 Get the selection level of the intersection. More...
 
int index (MStatus *ReturnStatus=NULL) const
 Get the index of the hit vertex, edge or triangle. More...
 
MStatus barycentricCoordinates (float &a, float &b) const
 Get the barycentric coordinates. More...
 
float edgeInterpolantValue (MStatus *ReturnStatus=NULL) const
 Get the edge interpolant value. More...
 
MFloatPoint intersectionPoint (MStatus *ReturnStatus=NULL) const
 Get the intersection point in object space. More...
 
int instanceID (MStatus *ReturnStatus=NULL) const
 Get the draw instance ID of the render item. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 

Member Function Documentation

MSelectionContext::SelectionLevel selectionLevel ( MStatus ReturnStatus = NULL) const

Get the selection level of the intersection.

Parameters
[out]ReturnStatusStatus code.
Returns
The selection level.
Status Codes:
int index ( MStatus ReturnStatus = NULL) const

Get the index of the hit vertex, edge or triangle.

It is the position in the index buffer of the render item geometry when provided, and the position in the vertex buffer if not.

Parameters
[out]ReturnStatusStatus code.
Returns
The index of the hit vertex, edge or triangle.
Status Codes:
+ Examples:
MStatus barycentricCoordinates ( float &  a,
float &  b 
) const

Get the barycentric coordinates.

Only valid for triangles. Follows Tomas Moller & Ben Trumbore, jgt 97 "Fast minimum storage ray/triangle intersection" which means that a point, T(a,b), on a triangle is given by: T(a,b) = (1-a-b)V0 + aV1 + bV2 where V0, V1, and V2 are the triangle vertices.

Parameters
[out]aThe first coordinate
[out]bThe second coordinate
Returns
Status code
Status Codes:
float edgeInterpolantValue ( MStatus ReturnStatus = NULL) const

Get the edge interpolant value.

Only valid for edges. It corresponds to the intersection position on the edge, from 0 to 1 starting at V0 going to V1.

Parameters
[out]ReturnStatusStatus code.
Returns
The edge interpolant value.
Status Codes:
MFloatPoint intersectionPoint ( MStatus ReturnStatus = NULL) const

Get the intersection point in object space.

Parameters
[out]ReturnStatusStatus code.
Returns
The intersection point.
Status Codes:
int instanceID ( MStatus ReturnStatus = NULL) const

Get the draw instance ID of the render item.

Only valid for instanced render items. See MPxSubSceneOverride::addInstanceTransform

Parameters
[out]ReturnStatusStatus code.
Returns
The draw instance ID.
Status Codes:
+ Examples:
const char * className ( )
static

Returns the name of this class.

Returns
Name of this class.

The documentation for this class was generated from the following files:
  • MSelectionContext.h
  • MSelectionContext.cpp